csf-dev / CSF.Screenplay

Implementation of the Screenplay pattern (aka Journey) in .NET
https://csf-dev.github.io/CSF.Screenplay/
MIT License
13 stars 1 forks source link

Reporting of errors causes the error to be duplicated up the stack #87

Closed craigfowler closed 7 years ago

craigfowler commented 7 years ago

When an error occurs and it is reported upon, the exception traverses upwards through the call stack and it's this reported upon several times at each nesting level of the performance.

I think that the reporter probably doesn't need to write all of these. So only the innermost level needs a report written for the exception. The others above it can skip the report.

craigfowler commented 7 years ago

This is quite easy to detect. If the report being written has any children then the error did not occur at the current step. This is our detection criteria for avoiding reporting the error.

craigfowler commented 7 years ago

It should be handled at the report writing level. It's actually quite handy to detect that a step has errors in its child steps. For example in an HTML layout we could display an icon (even though we will report the error in full where it happened).