Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Issue: HttpError only reports the absolute inner exception losing any exception stack [252]

$
0
0
If we have an action with the following code:

Exception exception = new Exception("0");
for (int count = 0; count < 10; count++)
{
exception = new Exception(count.ToString(), exception);
}

throw exception;

then only the inner exception (with message “0”) will get reported to the client:

{"Message":"An error has occurred.","ExceptionMessage":"0","ExceptionType":"System.Exception","StackTrace":null}

The reason is that we use Exception.GetBaseException() which automatically unwraps to the absolute inner exception.

A better model would be to an exception-unwrap implementation that only unwraps certain specific exceptions such as AggregateException and TargetInvocationException.

Henrik


Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>