NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
859 stars 170 forks source link

Url to errors #139

Closed radenkozec closed 5 years ago

radenkozec commented 5 years ago

I am using .NET Core 2.1 version of StackExchange.Exceptional. I don't know url and route to see errors page. URL to errors is not mentioned in documentation. I found on some old stackoverflow questions that URL is Exceptions.axd but not working? Can you point me to the URL?

stijnherreman commented 5 years ago

Maybe it's not very clear but this is mentioned in the docs at https://nickcraver.com/StackExchange.Exceptional/AspDotNetCore

Routes

For convenience, there is an easy to add route handler to render your errors. This way you can lock down the route using your current security models. The route iself is simple, in any controller (probably an admin or localhost controller):

public async Task Exceptions() => await ExceptionalMiddleware.HandleRequestAsync(HttpContext);

So in a Controller of your choice, add an Action that returns await ExceptionalMiddleware.HandleRequestAsync(HttpContext);.

There does seem to be an issue with the CSS and JS. I get a 200 for https://localhost:44357/logging/exceptions but a 404 for https://localhost:44357/logging/exceptions/css?v=... and https://localhost:44357/logging/exceptions/js?v=...

Personally I use https://github.com/opserver/Opserver to visualise errors across applications.

radenkozec commented 5 years ago

@NickCraver Thanks. It was not clear or easy to find that.

NickCraver commented 5 years ago

@radenkozec Where in the docs were you looking? It's it's unclear we should definitely fix that with a note and a link perhaps.

radenkozec commented 5 years ago

@NickCraver https://nickcraver.com/StackExchange.Exceptional/AspDotNetCore I have read at but I did not understand it. I thought it is just for replace default route or something like that especially because it was in the end of documentation. I suggest that it needs to be in the begging of documentation and with more detailed example of controller code.

NickCraver commented 5 years ago

Gotcha - to help I added links right after the screenshots on the main screen: https://nickcraver.com/StackExchange.Exceptional/ - if it's still an issue I welcome more doc improvements there.

After ASP.NET Core 2.2, the routing engine will be available in middleware and registering one automatically as a simple setting path will be possible...can't do much until then in terms on improving on the code side though, only docs for now.