Skip to content

fix: Added RequestException class to fix unhandled exception#116

Merged
shafqatfarhan merged 1 commit intomainfrom
shafqat/fix-http-error
Aug 18, 2025
Merged

fix: Added RequestException class to fix unhandled exception#116
shafqatfarhan merged 1 commit intomainfrom
shafqat/fix-http-error

Conversation

@shafqatfarhan
Copy link
Contributor

Merge checklist:
Check off if complete or not applicable:

  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

Post-merge:

Copilot AI review requested due to automatic review settings August 18, 2025 12:07
@shafqatfarhan shafqatfarhan requested a review from a team as a code owner August 18, 2025 12:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an unhandled exception by adding urllib3's HTTPError class to the exception handling in the SDN check functionality. The change ensures that both requests and urllib3 HTTP errors are properly caught and handled by the fallback mechanism.

  • Added urllib3.exceptions.HTTPError import and exception handling
  • Updated test coverage to verify both urllib3 and requests HTTPError exceptions are handled
  • Renamed existing test method to clarify it specifically tests requests HTTPError

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
sanctions/apps/api/v1/views.py Added urllib3.exceptions.HTTPError to exception handling in SDN check
sanctions/apps/api/v1/tests/test_views.py Added test for urllib3 HTTPError and renamed existing test for clarity

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  sanctions/apps/api/v1
  views.py
Project Total  

This report was generated by python-coverage-comment-action

@shafqatfarhan shafqatfarhan merged commit cacb487 into main Aug 18, 2025
6 checks passed
@shafqatfarhan shafqatfarhan deleted the shafqat/fix-http-error branch August 18, 2025 12:42
@shafqatfarhan shafqatfarhan changed the title fix: Added urllib3's HTTPError class to fix unhandled exception fix: Added RequestsException class to fix unhandled exception Aug 18, 2025
@shafqatfarhan shafqatfarhan changed the title fix: Added RequestsException class to fix unhandled exception fix: Added RequestException class to fix unhandled exception Aug 18, 2025
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.

3 participants