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

Explain the behavior of finally blocks in the readme examples #12

Open
IanButterworth opened this issue Nov 23, 2021 · 3 comments
Open

Comments

@IanButterworth
Copy link
Member

From the readme it's not clear what happens if there's a finally on the try-catch blocks. It would be good to explain when those finally blocks are called in the retry process

@IanButterworth
Copy link
Member Author

IanButterworth commented Nov 23, 2021

Also, I think the current behavior of finally is a bit unexpected

I think it's reasonable to expect the following:

julia> Retry.@repeat 3 try
               error()
       catch e
               println("catch");
               @delay_retry if e isa ErrorException end
       finally
               println("finally")
       end
catch
catch
catch
finally
ERROR: 
Stacktrace:
 [1] error()
   @ Base ./error.jl:42
 [2] top-level scope
   @ ~/.julia/packages/Retry/vS1bg/src/repeat_try.jl:192

@mattBrzezinski
Copy link
Member

Do you have an example of current behaviour? Your blob for expected is what I would assume is happening here.

@IanButterworth
Copy link
Member Author

IanButterworth commented Nov 24, 2021

Current behavior:

julia> Retry.@repeat 3 try
               error()
       catch e
               println("catch");
               @delay_retry if e isa ErrorException end
       finally
               println("finally")
       end
catch
finally
catch
finally
catch
finally
ERROR: 
Stacktrace:
 [1] error()
   @ Base ./error.jl:42
 [2] top-level scope
   @ ~/.julia/packages/Retry/vS1bg/src/repeat_try.jl:192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants