Skip to content
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

finally doesn't rethrow the stacktrace #27484

Closed
vtjnash opened this issue Jun 8, 2018 · 5 comments
Closed

finally doesn't rethrow the stacktrace #27484

vtjnash opened this issue Jun 8, 2018 · 5 comments
Labels
domain:error handling Handling of exceptions by Julia or the user kind:bug Indicates an unexpected problem or unintended behavior

Comments

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 8, 2018

julia> corrupt_stacktrace() = error("destroy stacktrace")

julia> f() = error("expected")
f (generic function with 1 method)

julia> try
        f()
       finally
        try; corrupt_stacktrace(); end
       end
ERROR: 
Stacktrace:
 [1] error at ./error.jl:33 [inlined]
 [2] corrupt_stacktrace at ./REPL[8]:1 [inlined] # should have been f!
 [3] macro expansion at ./REPL[14]:4 [inlined]
 [4] top-level scope at ./<missing>:0
@vtjnash vtjnash added kind:bug Indicates an unexpected problem or unintended behavior domain:error handling Handling of exceptions by Julia or the user labels Jun 8, 2018
@JeffBezanson
Copy link
Sponsor Member

Duplicate of #19979?

@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Jun 8, 2018

No, those are all for try/catch. This one is reporting that try/finally is also broken, and that none of the workarounds or fixes mentioned there would be applicable.

@JeffBezanson
Copy link
Sponsor Member

I think @c42f 's proposal of a stack of exceptions would fix it; after the inner try; corrupt... catch the backtrace would be reset to the previous one.

@c42f
Copy link
Member

c42f commented Jun 13, 2018

Yes, I think an exception stack would fix this just as it fixes various other problems of nested exception handling.

@c42f
Copy link
Member

c42f commented Oct 24, 2018

Fixed in #28878

@c42f c42f closed this as completed Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error handling Handling of exceptions by Julia or the user kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants