Skip to content

Commit 3137d44

Browse files
committed
Rename current_backtrace keyword include_bt to backtrace
1 parent 799c93f commit 3137d44

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

base/error.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,20 @@ Get the stack of exceptions currently being handled. For nested catch blocks
102102
there may be more than one current exception in which case the most recently
103103
thrown exception is last in the stack. The stack is returned as an
104104
`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
106106
will be set to `nothing`.
107107
108108
Explicitly passing `task` will return the current exception stack on an
109109
arbitrary task. This is useful for inspecting tasks which have failed due to
110110
uncaught exceptions.
111111
"""
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))
114114
formatted = Any[]
115-
stride = include_bt ? 3 : 1
115+
stride = backtrace ? 3 : 1
116116
for i = reverse(1:stride:length(raw))
117117
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
119119
push!(formatted, (exception=exc,backtrace=bt))
120120
end
121121
ExceptionStack(formatted)

test/exceptions.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ end
233233
yield(t)
234234
@test t.state == :failed
235235
@test t.result == ErrorException("B")
236-
@test current_exceptions(t, include_bt=false) == [
236+
@test current_exceptions(t, backtrace=false) == [
237237
(exception=ErrorException("A"),backtrace=nothing),
238238
(exception=ErrorException("B"),backtrace=nothing)
239239
]

0 commit comments

Comments
 (0)