tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.75k stars 139 forks source link

Fix error not being reported properly #396

Open jessie-ross opened 2 years ago

jessie-ross commented 2 years ago

This PR fixes a gap in errors being reported. Related to #256

I haven't looked at the whole code context so I am not sure if this is the best way to do so - let me know.

Replicating the issue:

  1. Create new deps.edn project.
  2. Add a file with a dash in it's name instead of an underscore (which every beginner is going to do 😭 ).
  3. Try to evaluate something in that file's context.
  4. See the same error as in #256
tpope commented 2 years ago

Can you share the full error output? E716 is pretty generic; I wouldn't jump to the conclusion that it's the same root cause as that 5 year old issue.

state.err in this context is stderr. Its presence does not necessarily warrant an exception.

jessie-ross commented 2 years ago

Can you share the full error output?

Sure!

Screen Shot 2021-12-07 at 12 18 38 pm

With the error occuring on this line.

And this is what I see with the fix:

Screen Shot 2021-12-07 at 12 17 18 pm
jessie-ross commented 2 years ago

state.err in this context is stderr. Its presence does not necessarily warrant an exception.

I am checking msg.err here, not sure if that is different, also msg.ex is set to an exception class if we want to branch on that.

tpope commented 2 years ago

I meant to say msg.err.

What are the full contents of msg.err? You can use let err = 'Clojure: ' . json_encode(msg) to check.