Skip to content

R35-T036: Clarify HTTP error handling - #126

Open
suraj-3010 wants to merge 1 commit into
S-AI-Projects:mainfrom
suraj-3010:student/e26b07f1007/R35-T036
Open

suraj-3010 wants to merge 1 commit into
S-AI-Projects:mainfrom
suraj-3010:student/e26b07f1007/R35-T036

Conversation

@suraj-3010

@suraj-3010 suraj-3010 commented Nov 22, 2026 •

Copy link
Copy Markdown

Description

This PR adds beginner-friendly regression coverage for connection() and performs one small readability refactor by isolating HTTP status-code message handling without changing public behavior.

Related Issue

Fixes: #36

Type of Change

  • Tests
  • Documentation
  • Refactoring / Maintenance

Changes Made

  • Extracted HTTP status-code message handling into _print_http_error(error) inside InstaDownloader/insta_down.py.
  • Preserved connection() arguments, mocked request behavior, return values, exception handling, and printed messages.
  • Added focused tests for default inputs, explicit URL and timeout, HTTP errors, and connection errors.
  • Added work/R35-T036/check.py and work/R35-T036/evidence.md.

Screenshots / Recordings

No UI changes.

Testing

Ran:

python3 work/R35-T036/check.py

Result: 4 tests passed. HTTP requests and response objects were mocked; no live internet or interactive CLI behavior was used.

Checklist

  • I have tested my changes locally.
  • I have added or updated tests, if needed.
  • I have updated documentation, if needed.
  • I have followed the project coding guidelines.
  • I have run the relevant tests and checks.

Additional Notes

The refactor makes the exact state clearer: an HTTP error response has a status code that is separated from the remaining connection logic and used to print the existing failure message.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@suraj-3010 suraj-3010 changed the title refactor(insta): clarify HTTP error handling Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant