Closed
Description
When our applications throw exceptions, we capture additional context in the .Data property of the exceptions. We would like to include this context in the NUnit output to reduce the time spent combing through logs and stepping through the debugger.
I've created two options for capturing additional information from exceptions. https://github.com/drewburlingame/nunit/pull/1
- Capture the exception in a new ExceptionResult.Exception property.
Pros:
* A straightforward change.
* It can be inspected by components for different purposes.
Con:
* Including the exception in the output of tests is more complicated, requiring an additional wrapper. The output will not be included as part of the default NUnit error message
- . Register a static delegate with ExceptionHelper.GetAdditionalDetails
Pros:
* A straightforward change.
* Very simple to use
* Context is included with the exception message, making it easier to correlate.
Cons:
* Doesn't fit with NUnit pattern of providing extensibility points via interfaces
* Global to the app domain. Cannot be enabled only for select fixtures. This isn't an issue for our use case but I assume there are cases where this may be an issue.
Would either of these be acceptable solutions? If not, do you have recommendations for how you'd like to see it?
Metadata
Metadata
Assignees
Labels
No labels