-
Notifications
You must be signed in to change notification settings - Fork 143
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
try/except around serialization blocks some workflows #87
Comments
I've realized I can update my custom exception to inherit from |
Hi, the idea of those But I do agree there is a valid use case. There is a bad design where anything happens inside serialization is swallowed in the data model level, which doesn't give the caller much control of exception handling. The right fix IMO is to have the The excessive |
You're right, I think my use case is a bit niche and I've worked around it by making it inherit from Having some way to customize which exceptions are ignored would probably be useful for someone but not for my application so I don't mind this issue being closed now. |
Thank you for explaining your use case and we appreciate your feedback. I'm closing this now and track this as a refactor item internally. |
I'm running long running functions AWS Lambda and using a
signal.signal(signal.SIGALRM, ...)
handler to raise a special exception to reschedule them when they approach the Lambda timeout. (They're structured in such a way that work done is saved in the DB so no progress is lost).Unfortunately it rarely happens that the signal fires at the same time as some object is being serialized by the X-Ray SDK, inside the
try/except
inserialize()
https://github.com/aws/aws-xray-sdk-python/blob/master/aws_xray_sdk/core/models/entity.py#L231 . I end up with a stack trace like:The
try / except
was added in the "initial commit" so it's not clear if it's really necessary to be so broad, maybe it can just coverTypeError
? jsonpickle docs for encode() don't even list a set of potential exceptions. There are also a bunch of othertry / except Exception
s littered through the library which might be able to be reduced in power.The text was updated successfully, but these errors were encountered: