-
Notifications
You must be signed in to change notification settings - Fork 2
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
summary: another band-aid for missing stacktrace #17
Conversation
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
src/exception_summary.jl
Outdated
@@ -143,9 +143,10 @@ function _summarize_exception(io::IO, exc, stack; prefix = nothing) | |||
end | |||
end | |||
# Now print just the very first frame we've collected: | |||
if isempty(bt) | |||
if ! @isdefined :bt || isempty(bt) |
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.
Perhaps we should define it as empty vector instead of local bt
, in case it doesn't enter the loop.
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.
👍 done in bd720cf.
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.
nice suggestion! FWIW Sagar, the previous code had a small typo in it. You want either of these two options: @isdefined(bt)
or isdefined(@__MODULE__, :bt)
. What you have is checking if the symbol exists and that will be a type error:
julia> @isdefined(:hi)
ERROR: LoadError: MethodError: no method matching var"@isdefined"(::LineNumberNode, ::Module, ::QuoteNode)
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.
😮 Thanks for pointing that out, @NHDaly! I see how this happened. Initially (before I filed this PR) I had written:
if !isdefined(Base, :bt) || isempty(bt)
which was correct (I think), but I didn't like it stylistically, so I pattern-matched changed it to:
if ! @isdefined :bt || isempty(bt)
which was definitely incorrect!
The following error was reported: UndefVarError: `bt` not defined Previously, a different error was reported where bt was a 0-length vector. Why the stacktrace is missing is not known in either case.
6468d11
to
bd720cf
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.
LGTM thanks. strange though, yeah..
The following error was reported:
Previously, a different error was reported where bt was a 0-length vector. Why the stacktrace is missing is not known in either case.