Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]CatchErrors in LogConverter - stackframe can be null and is not treated in code #102

Closed
ionutcalin opened this issue Aug 22, 2020 · 0 comments · Fixed by #117
Closed
Labels
bug Something isn't working

Comments

@ionutcalin
Copy link

ionutcalin commented Aug 22, 2020

In CatchErrors method of LogConverter for Serilog you are trying to get first frame from the stacktrace of each exception (and also for all inner exceptions).
The problem is that the frame is not tested for null and it will throw an exception when trying to obtain the fileName, method etc.

To reproduce is very simple. In user code (in a controller for instance) just add this line:
throw new ApplicationException("lorem...", new ApplicationException("ipsum"));

Obs.: For the inner exception the stack trace will have no frames as it was issued in the same context like the outer exception and this will cause the LogConverter to fail on CatchErrors methon when treating the inner exceptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant