-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add err
global to REPL to store most recent errors
#40642
Conversation
Is it possible that
in favour of this:
|
I do like |
errs
global to REPL to store most recent errorserr
global to REPL to store most recent errors
Using the awesome AbbreviatedStackTraces, I find myself very often typing "errs" instead of "err". This creates a new error, and sends my previous stacktrace to oblivion. Not sure what if anything should be done to prevent against that, but I'm just putting it out there in case someone has an idea. |
The same thing happens with Could it be a vector of exceptions that is pushed into each time? Maybe just keep the last 5 to avoid unending growth in a long session? Though wouldn't be as nice to dump 5 full traces at once accidentally either. |
Maybe stack traces originating right at top level don't get stored? Or just those errors that Julia doesn't display traces for normally. (maybe that's the same thing) |
Could be good: err for the latest, errs for an array of the latest. You can avoid dumping them all by having custom printing for the |
@antoine-levitt - I'm testing out, both here and in AbbreviatedStackTraces.jl, the idea that |
fa6f288
to
ef18cf1
Compare
4e6b4a6
to
2c27fe5
Compare
2c27fe5
to
701aafa
Compare
Now that 1.7 is just about out, wanted to raise this PR again. Summarizing:
I believe the one outstanding previously-mentioned issue might be ensuring Is there anything else? |
866188b
to
d5a3c29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very excited about this, and every couple weeks wonder why it isn't merged yet. Thanks for getting back to it.
I don't want it to be added to this PR, but I think having another variable that is all of the previous results, errors, and expressions would be excellent. |
d5a3c29
to
31d4bf4
Compare
I think that does it. I also noticed that the |
Hmm... Lots of random test failures but one consistent one. Somehow a precompile test is failing. Unfortunately the test failure message is a bit unclear as to what was expected vs. actual.
EDIT: Oh, it's just that it's not scrubbed of REPL frames now, which adds a double-digit frame and indents the whole output by an additional space. |
That should do it. Restored scrubbing of REPL frames everywhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me, but need to put back the old functions (they don't need the scrub_repl_backtrace work), since there are many packages that have been relying on them.
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Split off from #40537, allows the last exception to be reprinted in the REPL.