Title: Inconsistent Error Handling Needs Standardization
Description:
While working with the SDK, I noticed that error handling is inconsistent across different modules, which makes it tricky to handle errors properly in production applications.
Current issues:
deal_status.py converts HTTP errors to raw text exceptions:
except requests.HTTPError as error:
raise Exception(error.response.text)
axios.py just re-raises exceptions without context:
except Exception as e:
raise e
upload.py prints errors before raising:
except Exception as e:
print(e)
raise e
This makes it really hard to:
- Know what kind of errors to expect and catch
- Debug issues when they occur
- Handle errors consistently in our applications
Suggestion:
We should create a standard error handling approach with:
- Custom exception classes for different error types (HTTP, Upload, Auth, etc.)
- Consistent error raising patterns across all modules
- Proper error context preservation (no raw text conversions)
- Remove print statements in favor of proper error messages
Title: Inconsistent Error Handling Needs Standardization
Description:
While working with the SDK, I noticed that error handling is inconsistent across different modules, which makes it tricky to handle errors properly in production applications.
Current issues:
deal_status.pyconverts HTTP errors to raw text exceptions:axios.pyjust re-raises exceptions without context:upload.pyprints errors before raising:This makes it really hard to:
Suggestion:
We should create a standard error handling approach with: