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

ExceptionalAsyncHandler via HttpHandler, throws exception #145

Closed seankearney closed 5 years ago

seankearney commented 5 years ago

When I navigate to /exceptions.axd, in the sample MVC application, I am getting the following error:

Server Error in '/' Application.
This operation is not supported for a relative URI.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: This operation is not supported for a relative URI.

Source Error: 

Line 128:                            context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
Line 129:                            context.Response.Cache.SetNoStore();
Line 130:                            string actualUrl = Uri.TryCreate(Url, UriKind.RelativeOrAbsolute, out var urlResult) ? urlResult.AbsolutePath : Url;
Line 131:                            Page(new ErrorListPage(store, settings, actualUrl, await store.GetAllAsync().ConfigureAwait(false)));
Line 132:                            return;

Source File: ...\src\StackExchange.Exceptional\ExceptionalAsyncHandler.cs    Line: 130 
NickCraver commented 5 years ago

Fixed via #146, thanks!