PreTeXtBook / pretext-cli

Command line interface for quickly creating, authoring, and building PreTeXt documents.
https://pretextbook.org
GNU General Public License v3.0
17 stars 18 forks source link

Failure modes for latex-image builds #191

Closed rbeezer closed 2 years ago

rbeezer commented 2 years ago

latex-image builds used to fail by not producing a PDF, issuing a warning, then (accidentally) raising exceptions on subsequent processing.

Now they fail with a clear warning, abandon the current image, and go on to try more. No exception raised.

Maybe that is a change for the CLI? You might say "success", when that was not really the case?

No matter what, I think I want to accumulate a list of failed images, and after all images are attempted, finish with an exception reporting the list, should it be non-empty.

Holler (soon!) if you think something different needs to be done. I'll report here, but will let you close this once you think any change in behavior has been addressed.

rbeezer commented 2 years ago

(soon!)

All done. ;-) But pending on a branch, until I hear back. No particular rush.

StevenClontz commented 2 years ago

Here's where we use latex_image_conversion in our build.diagrams: https://github.com/PreTeXtBook/pretext-cli/blob/main/pretext/build.py#L60

This is (probably?) only called once in the library, here: https://github.com/PreTeXtBook/pretext-cli/blob/main/pretext/project.py#L271

If I understand what's happening, then we will indeed say "Success" at https://github.com/PreTeXtBook/pretext-cli/blob/main/pretext/project.py#L271 since no exception was raised. I'm not sure how we can stop that without the core scripts giving us an exception.

rbeezer commented 2 years ago

I'm not sure how we can stop that without the core scripts giving us an exception.

Perhaps I wasn't clear. I have the core Python raising an exception if any one of the latex-image fail. On a branch. I'll push it right now.

rbeezer commented 2 years ago

See https://github.com/rbeezer/mathbook/commit/a9f5bd294a8f3e408e220eb9d8a1caf96955f4a5

StevenClontz commented 2 years ago

Okay - we don't handle any exceptions when we call latex_image_conversion so we should error out before claiming "success" on a diagrams build, making this issue closable.

(That said, there are plenty of edge cases where we claim success when I wouldn't really evaluate the build as a "success", but that's a bigger issue.)