@@ -102,20 +102,20 @@ Get the stack of exceptions currently being handled. For nested catch blocks
102
102
there may be more than one current exception in which case the most recently
103
103
thrown exception is last in the stack. The stack is returned as an
104
104
`ExceptionStack` which is an AbstractVector of named tuples
105
- `(exception,backtrace)`. If `include_bt ` is false, the backtrace in each pair
105
+ `(exception,backtrace)`. If `backtrace ` is false, the backtrace in each pair
106
106
will be set to `nothing`.
107
107
108
108
Explicitly passing `task` will return the current exception stack on an
109
109
arbitrary task. This is useful for inspecting tasks which have failed due to
110
110
uncaught exceptions.
111
111
"""
112
- function current_exceptions (task= current_task (); include_bt = true )
113
- raw = ccall (:jl_get_excstack , Any, (Any,Cint,Cint), task, include_bt , typemax (Cint))
112
+ function current_exceptions (task= current_task (); backtrace = true )
113
+ raw = ccall (:jl_get_excstack , Any, (Any,Cint,Cint), task, backtrace , typemax (Cint))
114
114
formatted = Any[]
115
- stride = include_bt ? 3 : 1
115
+ stride = backtrace ? 3 : 1
116
116
for i = reverse (1 : stride: length (raw))
117
117
exc = raw[i]
118
- bt = include_bt ? Base. _reformat_bt (raw[i+ 1 ],raw[i+ 2 ]) : nothing
118
+ bt = backtrace ? Base. _reformat_bt (raw[i+ 1 ],raw[i+ 2 ]) : nothing
119
119
push! (formatted, (exception= exc,backtrace= bt))
120
120
end
121
121
ExceptionStack (formatted)
0 commit comments