binaryage / binaryage/cljs-devtools

Custom formatter for ex-info thrown by cljs.spec

Open
#23 8 comments 0 reactions 0 assignees View on GitHub
cljs-bug enhancement
Dominant language
Clojure
Stars
1.1k
Forks
51
PR merge metrics
No merged PRs in 30d

Description

Currently it's quite tricky to get good output from cljs.spec. Reason being that the ex-info thrown includes the full spec commentary in ex-message. This includes the serialised val which failed. In my case this can fill the console many times over.

Alex Miller recommended catching these exceptions and using the ex-data to present the spec nicely. (e.g. don't print the ex-message to the console). This would be fine except it's difficult to catch all errors due to the nature of how UI code executes (react render loop, re-frame dispatch queue, callbacks)

How about automatically detecting and pretty formatting ex-info errors thrown by cljs.spec?

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points. Start by locating where cljs-devtools handles uncaught errors from UI render loops, re-frame dispatch queues, and callbacks, then determine how cljs.spec ex-info can be identified and formatted without printing ex-message. Done means the behavior is defined and covered for the described error paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.