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

Make HTTP.jl exception types more consistent #846

Merged
merged 2 commits into from Jun 14, 2022
Merged

Make HTTP.jl exception types more consistent #846

merged 2 commits into from Jun 14, 2022

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Jun 14, 2022

Closed #792. In particular, calling HTTP.request will result
in one of four possible exceptions:

  • HTTP.ConnectError: something went wrong trying to make a connection to the remote
  • HTTP.RequestError: something went wrong sending/receiving request/response
  • HTTP.StatusError: a 4XX or 5XX response status code was received and status_exception=true
  • HTTP.TimeoutError: the request timed out waiting for a response (if readtimeout != 0)

Looking over open issues and how downstream repos use HTTP.jl, I found it would be helpful if
HTTP.jl indeed had more consistent exception types in place for 1.0 that packages could rely on.

Closed #792. In particular, calling `HTTP.request` will result
in one of four possible exceptions:
  * `HTTP.ConnectError`: something went wrong trying to make a connection to the remote
  * `HTTP.RequestError`: something went wrong sending/receiving request/response
  * `HTTP.StatusError`: a 4XX or 5XX response status code was received and status_exception=true
  * `HTTP.TimeoutError`: the request timed out waiting for a response (if `readtimeout` != 0)

Looking over open issues and how downstream repos use HTTP.jl, I found it would be helpful if
HTTP.jl indeed had more consistent exception types in place for 1.0 that packages could rely on.
@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2022

Codecov Report

Merging #846 (a2f26df) into master (b71aded) will increase coverage by 0.08%.
The diff coverage is 88.88%.

@@            Coverage Diff             @@
##           master     #846      +/-   ##
==========================================
+ Coverage   80.95%   81.04%   +0.08%     
==========================================
  Files          35       36       +1     
  Lines        2757     2754       -3     
==========================================
  Hits         2232     2232              
+ Misses        525      522       -3     
Impacted Files Coverage Δ
src/ConnectionPool.jl 87.93% <ø> (ø)
src/ExceptionRequest.jl 100.00% <ø> (+12.50%) ⬆️
src/HTTP.jl 83.05% <ø> (ø)
src/IOExtras.jl 77.14% <ø> (+0.95%) ⬆️
src/RetryRequest.jl 65.38% <75.00%> (+0.16%) ⬆️
src/Exceptions.jl 83.33% <83.33%> (ø)
src/ConnectionRequest.jl 77.02% <100.00%> (+0.31%) ⬆️
src/StreamRequest.jl 100.00% <100.00%> (ø)
src/Streams.jl 96.40% <100.00%> (-0.03%) ⬇️
src/TimeoutRequest.jl 90.47% <100.00%> (+7.14%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@quinnj quinnj merged commit ddc449f into master Jun 14, 2022
@quinnj quinnj deleted the jq/792 branch June 14, 2022 21:15
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.

Consistent exception types and error reporting
2 participants