RFC: Remove 'Stack trace' from break loop messages (???)#6429
Conversation
ThomasBreuer
left a comment
There was a problem hiding this comment.
I thought the format was inspired by that of the error messages in Julia, where the specific message text is followed by a line Stacktrace: (not Stack trace:) and then the description of the call stack, with numbers for the levels.
I have no preference for keeping the line in question or leaving it out.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6429 +/- ##
=======================================
Coverage 78.87% 78.87%
=======================================
Files 685 685
Lines 293550 293547 -3
Branches 8672 8672
=======================================
Hits 231530 231530
+ Misses 60211 60209 -2
+ Partials 1809 1808 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Sorry, I was unclear: I am not necessarily saying we should merge this PR. I am just unsure if printing this line is good, bad or neutral. Personally I don't mind it an am also used to something like it from e.g. Julia. But I feel it kinda "slipped in under the radar" with PR #6257. So this is now an attempt to hear what others think about it: keep it? remove it again? or maybe adjust it? |
| if OnBreak = Where or OnBreak = WhereWithVars then | ||
| PrintTo(ERROR_OUTPUT, "Stack trace:\n"); | ||
| fi; |
There was a problem hiding this comment.
Note also this implementation is a bit wonky. Perhaps Stack trace: should always be printed in Where?
There was a problem hiding this comment.
Ah and this also breaks when certain packages are loaded: e.g. for me Browse is autoloaded, and therefore I never see the Stack trace::
gap> Display(OnBreak);
# /Users/mhorn/Projekte/GAP/gap/pkg/browse/lib/ncurses.gi:437
function ( )
if not NCurses.isendwin( ) then
NCurses.endwin( );
fi;
OnBreakSavedByBrowse( );
return;
end
There was a problem hiding this comment.
See PR #6432 for an attempt to clean this up.
| gap> IsNormal(2,2); | ||
| Error, no method found! For debugging hints type ?Recovery from NoMethodFound | ||
| Error, no 1st choice method found for `IsNormal' on 2 arguments | ||
| Stack trace: |
There was a problem hiding this comment.
Here is an example of Stack trace: with an "empty" stack trace; this is what first lead to me questioning whether this line is helpful or not...
a51536f to
8dc2e93
Compare
|
I prefer the message staying, at least when it's actually followed by a stack trace. Reason being that I think it might make errors clearer for users that have little programming experience. If I didn't know what a stack trace was and I saw this: Then I'd probably be unsure whether this is all one big error message or not, and what to do with it. Whereas if I saw I'd know that the first line is the actual error message, and everything below is something that's called a "stack trace", which I could then google. |
I've added this in PR #6257 but now am not so sure anymore I like it, and the way it is inserted. See this comment on PR #6416.