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

DEVX-6461: Improving Exceptions for API Errors #287

Merged
merged 5 commits into from
Sep 25, 2023

Conversation

superchilled
Copy link
Contributor

@superchilled superchilled commented Sep 23, 2023

This PR:

  • Adds additional context to some exception types.
    • It creates a new exception type Vonage::APIError from which Vonage::ClientError and Vonage::ServerError now inherit.
    • When an exception resulting from an API response not in the 2xx/3xx range, when the exception is raised the Net::HTTPResponse object is now made available as a property on the exception
    • Unit tests have been added/updated to cover the new functionality.

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2023

Codecov Report

Merging #287 (fc6470b) into main (44f2bb6) will decrease coverage by 0.03%.
The diff coverage is 94.87%.

❗ Current head fc6470b differs from pull request most recent head 5aadc81. Consider uploading reports for the commit 5aadc81 to get more accurate results

@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
- Coverage   97.96%   97.93%   -0.03%     
==========================================
  Files         107      108       +1     
  Lines        1967     1988      +21     
==========================================
+ Hits         1927     1947      +20     
- Misses         40       41       +1     
Files Changed Coverage Δ
lib/vonage.rb 91.66% <ø> (ø)
lib/vonage/errors.rb 94.44% <88.23%> (-2.70%) ⬇️
lib/vonage/api_error.rb 100.00% <100.00%> (ø)
lib/vonage/client_error.rb 100.00% <100.00%> (ø)
lib/vonage/server_error.rb 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@superchilled superchilled marked this pull request as ready for review September 24, 2023 16:46
@superchilled superchilled merged commit b3122cb into main Sep 25, 2023
17 checks passed
@superchilled superchilled deleted the devx-6461-improve-exception-handling branch September 25, 2023 10:23
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