Skip to content

Commit

Permalink
Keep the files if conversion from latex to pdf fails
Browse files Browse the repository at this point in the history
It is quite hard to debug something if you have a cleaned up crime
scene. So if the conversion from LaTeX to pdf fails we move the
temporary files to /tmp/daisyproducer2-failed so that they can be
inspected later on.
  • Loading branch information
egli committed Feb 13, 2025
1 parent 8e7d6ad commit 0600cf0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/clj/daisyproducer2/pipeline1.clj
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@
(fs/move pdf-path output {:replace-existing true})
(catch clojure.lang.ExceptionInfo e
(log/error (ex-message e))
;; move the failing tex files away for later inspection
(fs/move tmp-dir (fs/create-dirs "/tmp/daisyproducer2-failed") {:replace-existing true})
(throw
(ex-info (format "Conversion of %s failed" input) {:error-id ::pdf-conversion-failed} e)))
(catch java.nio.file.NoSuchFileException e
Expand Down

0 comments on commit 0600cf0

Please sign in to comment.