Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Catchable exceptions #109

Open
Open
@devurandom

Description

When 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月08日T00: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, or if it would pass through the original Java exceptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /