-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
warn: remove
depth
keyword, no backtraces; warn(err::Exception).
Since it's completely unclear what this does or how to use it, I'm deleting this feature. When `depth=0` backtraces seem to show, while when `depth=1` they don't or something like that. Now we just don't ever show backtraces for warnings. This keyword didn't do anything for the info function since we never print backtraces there. Also added a warn(err::Exception) method that prints an error the way it would look if allowed to kill the current task, but doesn't actually kill the current task. This is useful if catch an error and want to show it to the user but continue running.
- Loading branch information
1 parent
29c8f3c
commit 0e37602
Showing
3 changed files
with
10 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0e37602
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.
That's a pity; it was handy to be able to see where deprecation warnings were coming from. I think this was helpful to package authors updating their code.
0e37602
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 fine with reinstating it but it should have an interface that makes sense and is documented. I was unable to figure out how to disable backtraces altogether despite spending a fair chunk of time looking at this code. Also, the code for showing warnigs and errors is kind of a hot mess – this stuff is spread all over the place: error.jl, client.jl, repl.jl, show.jl; there's probably even more places.
0e37602
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.
Depth indicates which levels of the backtrace to print. It can be a number which is used to guess the callers frame by addin one each step, or a range, or a list. Sufficiently large or small numbers should prevent any backtrace. Ideally, we could insert this information at compile time via FILE or something, but I'm not clear how that could be made feasible.