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

Remove extra parens when no stacktrace available. #12

Merged
merged 1 commit into from
Jun 2, 2014

Conversation

jenanwise
Copy link
Contributor

weasel.repl/process-message for :eval-js currently tries to call the string "No stacktrace available" when processing an error with no stacktrace. This results in a new error and the repl hanging. Instead it should just return the string as a value, which would match the behavior of clojure.browser.repl/evaluate-javascript.

`weasel.repl/process-message` for `:eval-js` currently tries to *call* the string "No stacktrace available" when processing an error with no stacktrace. This results in a new error and the repl hanging. Instead it should just return the string as a value, which would match the behavior of `clojure.browser.repl/evaluate-javascript`.
tomjakubowski added a commit that referenced this pull request Jun 2, 2014
Remove extra parens when no stacktrace available.
@tomjakubowski tomjakubowski merged commit 8de9f3c into nrepl:master Jun 2, 2014
@tomjakubowski
Copy link
Collaborator

thanks!

@the-kenny
Copy link
Contributor

Is there a chance to cut a new release for this? I'm running in this error quite often in conjunction with primatic/schema.

@tomjakubowski
Copy link
Collaborator

@the-kenny Just released 0.2.1 with this fix and a related one.

Out of curiosity, where does it happen that a js/Error object lacks the stack property? Older versions of IE? Some kind of manually constructed Error in a promise library?

@the-kenny
Copy link
Contributor

No browser at all. It's caused by prismatic/schema when the validation of a schema via validate fails.

@tomjakubowski
Copy link
Collaborator

Prismatic seems to throw ExceptionInfo objects rather than native js/Error objects in some circumstances. Apparently these ExceptionInfo objects don't have a stack property, although I'm seeing one (albeit not a very useful one) in my tests. If I recall extending the native js/Error object like that can lead to some weird behavior.

I did notice that the error message for these doesn't include the bit of useful extra data passed to ex-info:

cljs.user> (throw (ex-info "foo" {:key-a 123 :key-b 456}))
#<Error: foo>
No stacktrace available.

so I opened an issue which I plan to tackle soon: #13

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.

3 participants