Replies: 1 comment
-
These exist:
Sometimes exceptions are reported by other code that catches exceptions and continues: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The most common thing to do with the Exceptions is to log them. It can be called one of those "cross-cutting concerns". How about a few global events to do just that? There can be events for "All", "Caught" and "Uncaught" exceptions. These events can be fired on the catch-site or crash-site of the exceptions.
To be clear, I think the events should just have a read-only access of the exceptions. Meaning the events should not be able to "handle" or "consume" them, only log/record them. So, it would not prevent a crash or affect current exception handling mechanism in any way. But it will provide an additional centralized way to log the exceptions. Also, recording uncaught exceptions can be a fairly useful new feature.
I also think that these events should only be available to "executable" assemblies, not the libraries. Also, for the "caught" exceptions, the catch-site should be limited to the same assembly only, not the libraries.
Something similar can be found in the JS ecosystems.
Beta Was this translation helpful? Give feedback.
All reactions