-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
custom base exceptions updated for pickling #2669
base: master
Are you sure you want to change the base?
custom base exceptions updated for pickling #2669
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2669 +/- ##
==========================================
- Coverage 90.20% 90.18% -0.02%
==========================================
Files 256 256
Lines 15691 15711 +20
==========================================
+ Hits 14154 14169 +15
- Misses 1537 1542 +5 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
self.exit_code = ( | ||
response.get("StatusCode", 1) if response else 1 | ||
) # we can assume this will be > 0 | ||
error: dict[Any, Any] | None = ( | ||
response.get("Error") if response else {} | ||
) # value from dict could be NoneType | ||
if error: | ||
self.message = error.get("Message", "error message undefined") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done without changing the signature by storing the response
on the object.
self.exit_code = ( | |
response.get("StatusCode", 1) if response else 1 | |
) # we can assume this will be > 0 | |
error: dict[Any, Any] | None = ( | |
response.get("Error") if response else {} | |
) # value from dict could be NoneType | |
if error: | |
self.message = error.get("Message", "error message undefined") | |
self._response = response | |
self.exit_code = response.get("StatusCode", 1) # we can assume this will be > 0 | |
error: dict[Any, Any] = response.get("Error") or {} # value from dict could be NoneType | |
self.message = error.get("Message", "error message undefined") |
Then, the __reduce__
method would return self.class, (self._response,)
Summary
Why This Is Needed
Implement exception pickling to prevent
TypeError
s as reported in issue #2405What Changed
Fixed
Runway custom exceptions pickling implemented.
Checklist