Comments (4)
I've realized I can update my custom exception to inherit from BaseException
to get it to raise through this statement, but there are probably other use cases still blocked by excessive try/except
through the library.
from aws-xray-sdk-python.
Hi, the idea of those try/except
blocks is that X-Ray tracing is not mission critical from an customer application's standpoint. It should not break the application because of any library internal issue or sometimes even instrumentation bug.
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 emitter
module to handle this exception since emitter is the one responsible for serialization and UDP transmission. That way you can override the emitter module and handle your custom exception the way you need.
The excessive try/except
act as a firewall between the library and your application code. We can improve those places case by case like this time but I would argue the current approach is better to begin with. Please let me know if you have any additional thoughts.
from aws-xray-sdk-python.
You're right, I think my use case is a bit niche and I've worked around it by making it inherit from BaseException
, which makes it a lot more like KeyboardInterrupt
/ SystemExit
which are also whole-program control-flow exceptions. At least nothing in xray is doing unspecified try/except
which is the evilest 😈 (actually one test does! test_async_local_storage.py
)
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.
from aws-xray-sdk-python.
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.
from aws-xray-sdk-python.
Related Issues (20)
- IndexError when using AWS X-Ray SDK with SQLAlchemy HOT 1
- EKSPlugin HOT 1
- Very rare ReferenceError HOT 2
- Support for psycopg3 HOT 2
- Link a Textract async operation with downstream process HOT 1
- Current tox versions do not like how testenv.passenv is set
- aws_xray_sdk.core.exceptions.exceptions.SegmentNameMissingException: Segment name is required. HOT 1
- Using psycopg2 connection_factory throws exceptions HOT 4
- Documentation for patch_all HOT 2
- Sampling configuration should discuss DefaultSampler vs. LocalSampler HOT 1
- Flask middleware errors when an earlier Flask extension throws an exception in a before_request method HOT 1
- Patched DB cursor and template may record outside of XRayMiddleware HOT 2
- Segment not propgated when subsegment metadata is sufficiently long HOT 4
- sqlalchemy_core patch errors for unencoded special characters in db url HOT 1
- Error when using AsyncContext in python 3.11.5 HOT 3
- MongoDB AttributeError: 'NoneType' object has no attribute 'put_annotation'
- aws-xray-sdk-python compatibility with Python 3.12 HOT 9
- Fix docstring in Entity.close() HOT 1
- No supported for fastAPI, need to add middleware for fastapi HOT 1
- Incompatible with Pynamodb 6.x HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-xray-sdk-python.