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

Do not swallow error response #54

Closed

Conversation

remix7531
Copy link
Contributor

quick fix for issue #47

@@ -118,7 +118,7 @@ impl BlockingClient {

match resp {
Ok(resp) => Ok(resp.into_json()?),
Err(ureq::Error::Status(code, _)) => Err(Error::HttpResponse(code)),
Copy link
Contributor

@tnull tnull Jul 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to keep this as Error::HttpResponse but augment the error variant with a message: '&static str or similar field, which should also be filled in the the async/reqwest counterpart.

@vladimirfomene vladimirfomene force-pushed the return-error-issue#47 branch 4 times, most recently from 7e9b436 to bb150e1 Compare July 20, 2023 18:32
@vladimirfomene vladimirfomene marked this pull request as ready for review July 20, 2023 18:32
@vladimirfomene vladimirfomene force-pushed the return-error-issue#47 branch 18 times, most recently from 8843adf to bf11848 Compare July 20, 2023 21:13
@vladimirfomene vladimirfomene force-pushed the return-error-issue#47 branch from bf11848 to 3502ba4 Compare July 20, 2023 21:20
@vladimirfomene vladimirfomene force-pushed the return-error-issue#47 branch from 3502ba4 to c4f53ae Compare July 21, 2023 06:57
@vladimirfomene
Copy link
Contributor

vladimirfomene commented Jul 21, 2023

@remix75 , @tnull and @notmandatory this is ready for review.

Copy link
Member

@notmandatory notmandatory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK with one suggestion for cont_integration.yml. Also be sure to do a final cargo fmt.

Comment on lines +54 to +58
cargo update -p log --precise 0.4.18 &&
cargo update -p rustls:0.21.5 --precise 0.21.1 &&
cargo update -p time:0.3.15 --precise 0.3.13 &&
cargo update -p hyper-rustls:0.24.1 --precise 0.24.0 &&
cargo update -p tempfile:3.7.0 --precise 3.6.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The && aren't needed when put on new lines like this.

Suggested change
cargo update -p log --precise 0.4.18 &&
cargo update -p rustls:0.21.5 --precise 0.21.1 &&
cargo update -p time:0.3.15 --precise 0.3.13 &&
cargo update -p hyper-rustls:0.24.1 --precise 0.24.0 &&
cargo update -p tempfile:3.7.0 --precise 3.6.0
cargo update -p log --precise 0.4.18
cargo update -p rustls:0.21.5 --precise 0.21.1
cargo update -p time:0.3.15 --precise 0.3.13
cargo update -p hyper-rustls:0.24.1 --precise 0.24.0
cargo update -p tempfile:3.7.0 --precise 3.6.0

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from a first pass!

Can we add some test fixtures of the error case on both (blocking/async) sides to check we're parsing the error responses correctly?

@vladimirfomene
Copy link
Contributor

I'm going to close this, the requested changes have been implemented in #58.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5534983433

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 68 of 111 (61.26%) changed or added relevant lines in 2 files are covered.
  • 74 unchanged lines in 3 files lost coverage.
  • Overall coverage remained the same at 80.688%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/async.rs 54 70 77.14%
src/blocking.rs 14 41 34.15%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 2 96.44%
src/async.rs 20 82.11%
src/blocking.rs 52 61.81%
Totals Coverage Status
Change from base Build 5409842518: 0.0%
Covered Lines: 844
Relevant Lines: 1046

💛 - Coveralls

@coveralls
Copy link

coveralls commented Mar 17, 2024

Pull Request Test Coverage Report for Build 5619546090

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 38 of 127 (29.92%) changed or added relevant lines in 2 files are covered.
  • 8 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-4.3%) to 76.349%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/async.rs 37 74 50.0%
src/blocking.rs 1 53 1.89%
Files with Coverage Reduction New Missed Lines %
src/async.rs 1 73.31%
src/blocking.rs 7 54.7%
Totals Coverage Status
Change from base Build 5409842518: -4.3%
Covered Lines: 849
Relevant Lines: 1112

💛 - Coveralls

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.

5 participants