Replies: 1 comment 1 reply
-
I'd like to understand the scenario where this occurs so we can address the issue. Normally what happens is that the exception that's thrown (the top level one) is a reflection exception, which is useless to everyone. That's why we use the innerException, which is the actual exception. By dropping the reflection exception, we keep the exception tree free of noise so it is more useful. Perhaps we have some scenario where the top level exception isn't a reflection exception, and I'd like to understand how that happens so we can address it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
really I just want to query why when an exception occurs, if an inner exception exists, it uses that instead?
In ServiceProviderMethodCaller.cs when an exception is caught, it does the below
Long story short, we have certain exceptions custom and not that potentially losing information when an Exception is thrown.
I recreated the 'issue' in the test ChildInnerExceptionFlowsFromDataPortal by throwing an inner exception inside of the CustomException as below
throw new CustomException("Insert not allowed", new OperationCanceledException());
In an ideal world, we need the CustomException to be the one that is captured, but that is not what is happening, and I just want to understand it
Beta Was this translation helpful? Give feedback.
All reactions