Skip to content

fix(errors): standardize error handling with custom exception classes#50

Open
laciferin2024 wants to merge 2 commits intolighthouse-web3:mainfrom
ideo-org:fix/issue-10-error-handling
Open

fix(errors): standardize error handling with custom exception classes#50
laciferin2024 wants to merge 2 commits intolighthouse-web3:mainfrom
ideo-org:fix/issue-10-error-handling

Conversation

@laciferin2024
Copy link

Fixes #10

Summary

Adds custom exception classes to standardize API and upload error handling, removing generic exception wrapping in the core paths touched by this issue.

Changes

  • Added src/lighthouseweb3/functions/exceptions.py with LighthouseError, LighthouseAPIError, and LighthouseUploadError.
  • Updated deal_status.py to raise LighthouseAPIError instead of generic exceptions.
  • Updated axios.py to raise LighthouseAPIError on HTTP failures.
  • Updated upload.py to raise LighthouseUploadError and avoid debug print noise.

Scope note

This PR is intentionally scoped to issue #10 error handling. PR #11 addresses broader concerns like type hints, docstrings, and resource management.

Validation

  • python -m unittest discover tests/

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.

Inconsistent Error Handling Needs Standardization

1 participant