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

Support showing stack trace for exceptions in editor binding and prompt #945

Closed
xiaq opened this issue Mar 22, 2020 · 2 comments
Closed

Support showing stack trace for exceptions in editor binding and prompt #945

xiaq opened this issue Mar 22, 2020 · 2 comments
Labels
Milestone

Comments

@xiaq
Copy link
Member

@xiaq xiaq commented Mar 22, 2020

Today if an editor binding or prompt throws an exception, Elvish only shows the error message and hides the full stack trace. It should be possible to show the full stack trace.

This can be implemented by supporting a flag $edit:show-exception-stack-trace, and show the stack trace when it is true.

@xiaq xiaq added the A:Editor label Mar 22, 2020
@xiaq xiaq added this to the 0.14 milestone Mar 22, 2020
@zzamboni
Copy link
Contributor

@zzamboni zzamboni commented Apr 28, 2020

A gentle ping on this - I'm still puzzled by an error I see sometimes, and which I have been unable to trace:

prompt function error: arity mismatch: arguments here must be 0 values, but is 1 value
@xiaq
Copy link
Member Author

@xiaq xiaq commented Apr 28, 2020

@zzamboni Rest assured that it's being prioritized - it's part of the 0.14 milestone :)

I am considering a different way to implement this:

  • Add a list variable $edit:exceptions to save exceptions.
  • Whenever an exception happens in one of the editor callbacks, print out the index where the exception is saved (e.g. exception saved in $edit:exceptions[3])
  • Add a builtin to print the full exception stack trace, e.g. show-exc $edit:exceptions[3].

It also makes sense to add a exc module for exceptions utilities, so the show-exc command can be exc:show instead.

xiaq added a commit that referenced this issue May 2, 2020
xiaq added a commit that referenced this issue May 2, 2020
This is preparing for the work of saving exceptions in a variable (#945).
@xiaq xiaq closed this in c53c094 May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.