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

add try/catch to all callback functions (never unwind through them) #206

Merged
merged 2 commits into from
Oct 2, 2022

Conversation

StefanKarpinski
Copy link
Sponsor Member

@StefanKarpinski StefanKarpinski commented Oct 1, 2022

This may help #196. The issue there may be that callback functions raise Julia errors sometimes (they shouldn't but stuff happens, ya know?). This wraps each one in a try/catch block and logs an "unkonwn error" message if that happens and returns from the callback with an appropriate return code to indicate error. The libcurl docs aren't super clear on these and this is hard to test so hopefully I got it right, but we'll see. Should be better.

This may help #196. The
issue there may be that callback functions raise Julia errors sometimes
(they shouldn't but stuff happens, ya know?). This wraps each one in a
try/catch block and logs an "unkonwn error" message if that happens and
returns from the callback with an appropriate return code to indicate
error. The libcurl docs aren't super clear on these and this is hard to
test so hopefully I got it right, but we'll see. Should be better.
@DilumAluthge
Copy link
Member

Is this backportable?

@StefanKarpinski
Copy link
Sponsor Member Author

Probably not cleanly, but the same thing could maybe be done on the old branch.

@codecov
Copy link

codecov bot commented Oct 1, 2022

Codecov Report

Merging #206 (7207eaf) into master (0733701) will decrease coverage by 2.56%.
The diff coverage is 77.66%.

@@            Coverage Diff             @@
##           master     #206      +/-   ##
==========================================
- Coverage   92.22%   89.65%   -2.57%     
==========================================
  Files           5        5              
  Lines         527      551      +24     
==========================================
+ Hits          486      494       +8     
- Misses         41       57      +16     
Impacted Files Coverage Δ
src/Curl/Easy.jl 91.72% <73.21%> (-4.05%) ⬇️
src/Curl/Multi.jl 91.33% <82.97%> (-2.88%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@StefanKarpinski StefanKarpinski merged commit 11b6bb7 into master Oct 2, 2022
@StefanKarpinski StefanKarpinski deleted the sk/try-catch branch October 2, 2022 16:21
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

Successfully merging this pull request may close these issues.

2 participants