You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I spec arguments of a function with a validation that occurs often throughout the codebase, it can be hard to find out what function I called with invalid arguments. I suggest to add the speced/defn that failed to the error report.
For example if now I call this function with a nil office id:
Just to be clear, do you not get a stracktrace along with with these error reports?
I admit the error reporting (the Validation failed message which comes from Expound) and the stacktrace are disjointed, i.e. the message and the stacktrace can be printed in different places (different windows of your IDE) and at different times (5 seconds later, or interspersed with unrelated output).
But disjointed or not, the stacktrace should be there, which probably would address most of your pains. 95% of the times I don't get disjointed output. (Things that can cause it: running tests, concurrency)
Can you confirm?
Btw, the Expound error reporting is currently hacked (we with-out-str it and manipulate it). If/when bhb/expound#148 is addressed, it might be reasonable to add more handy fields to it, but meanwhile I'd preferably keep the hacking at a minimum.
--
Even cooler would be if I also knew where this function got called from, but I can imagine that's a lot more involved.
(This specific suggestion seems off since it'd largely duplicate Clojure's throw mechanism which already informs you of the stacktrace)
When I spec arguments of a function with a validation that occurs often throughout the codebase, it can be hard to find out what function I called with invalid arguments. I suggest to add the speced/defn that failed to the error report.
For example if now I call this function with a nil office id:
Where you now get
Would become something like
Even cooler would be if I also knew where this function got called from, but I can imagine that's a lot more involved.
The text was updated successfully, but these errors were encountered: