Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catchable exceptions #109

Open
devurandom opened this issue Apr 8, 2024 · 0 comments
Open

Catchable exceptions #109

devurandom opened this issue Apr 8, 2024 · 0 comments

Comments

@devurandom
Copy link

devurandom commented Apr 8, 2024

Then conversion fails, java-time.api wraps the java.time.format.DateTimeParseException in clojure.lang.ExceptionInfo, which I cannot distinguish from any other exception when trying to catch:

(import '(java.time.format DateTimeParseException))

(try
  (t/zoned-date-time "2024-04-08T00:00:00")
  (catch DateTimeParseException _
    (println "CAUGHT")))

java.time.format.DateTimeParseException: Text '2024-04-08T00:00:00' could not be parsed at index 19
             clojure.lang.ExceptionInfo: Conversion failed

It would be convenient if java-time.api would throw with some form of :type key in the map that I could catch with e.g. https://github.com/gfredericks/catch-data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant