Skip to content

Conversation

@emlyn
Copy link

@emlyn emlyn commented Dec 7, 2025

If something like (throw (ex-info "message" {:some "data"})) goes unhandled, it would be useful to be able to see the data in the error message. Currntly that is not visible:
Screenshot 2025-12-07 175223

@mk
Copy link
Member

mk commented Dec 8, 2025

I've tried this but I don't see the ex-data in the viewer, does this work for you? Can you make it so it works with notebooks/boom.clj and paste a screenshot of the ex-data being shown?

@emlyn
Copy link
Author

emlyn commented Dec 8, 2025

Sorry, I should have tested this before opening a PR...
I'm not sure how this all works, but it looks to me like the ExceptionInfo thrown in Clojure is no longer an ExceptionInfo when it gets to the ClojureScript render code. I'll try to dig into it a bit further to see if I can work out what's going on if I have the time.

@mk
Copy link
Member

mk commented Dec 8, 2025

Yep, clerk catches the exception and rethrows it after running it through Throwable->map and clojure.main/ex-triage:

(utils/if-bb
(throw t)
(let [triaged (main/ex-triage (Throwable->map t))]
(throw (ex-info (main/ex-str triaged)
(merge triaged (analyzer/form->ex-data form)))))))))

Since ex-data can contain things that can't be serialized or contain too much data to send over the wire, it's run through clerk's presentation.

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

Successfully merging this pull request may close these issues.

2 participants