Skip to content

Conversation

@armando-rodriguez-cko
Copy link
Contributor

This pull request enhances the CheckoutApiException class to provide more detailed error information, including the request_id and error_type fields. It also updates the test suite to validate these new additions and ensures better error handling in various scenarios.

Enhancements to Exception Handling:

  • Updated the CheckoutApiException class to include request_id and error_type fields, populated from the response body or headers as a fallback. Improved error handling for missing or malformed JSON responses. (checkout_sdk/exception.py)
  • Updated the documentation to reflect the new request_id and error_type attributes in the exception handling example. (README.md)

Test Suite Updates:

  • Modified existing tests and added new ones to validate the presence of request_id and proper fallback mechanisms when it is missing in the response body. (tests/exception_test.py) [1] [2]
  • Enhanced integration tests to assert the presence of request_id in error scenarios. (tests/payments/request_apm_payments_integration_test.py)

Miscellaneous:

  • Updated the expiry_year for VisaCard test data to extend its validity. (tests/checkout_test_utils.py)

@armando-rodriguez-cko armando-rodriguez-cko requested a review from a team July 25, 2025 09:12
@armando-rodriguez-cko armando-rodriguez-cko force-pushed the feature/feat-enhance-CheckoutApiException-to-include-request_id-and-improve-error-handling branch 5 times, most recently from 42eafd4 to a74ec3d Compare July 25, 2025 11:38
@armando-rodriguez-cko armando-rodriguez-cko force-pushed the feature/feat-enhance-CheckoutApiException-to-include-request_id-and-improve-error-handling branch from a74ec3d to 6f7aef2 Compare July 25, 2025 11:38
@sonarqubecloud
Copy link

@armando-rodriguez-cko armando-rodriguez-cko merged commit db8f032 into main Jul 25, 2025
6 checks passed
@armando-rodriguez-cko armando-rodriguez-cko deleted the feature/feat-enhance-CheckoutApiException-to-include-request_id-and-improve-error-handling branch July 25, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants