I’m having a difficult time tracking this one down. The static file handler ends up returning a 500 for files that don’t exist although it is throwing HttpError.NotFound(). Here is an example on servicestack.net (https://servicestack.net/js/default.min.js)
Can you enable <customErrors mode=“Off”/> so we can see the underlying exception?
Jeff Gabhart:
System.AggregateException: One or more errors occurred. —> ServiceStack.HttpError: Static File ‘/scripts/file.min.js’ not found
at ServiceStack.Host.Handlers.StaticFileHandler.<>c__DisplayClass1.<ProcessRequest>b__0(IResponse r)
at ServiceStack.HttpExtensions.EndHttpHandlerRequest(IResponse httpRes, Boolean skipHeaders, Boolean skipClose, Action1 afterHeaders)<br> at System.Threading.Tasks.Task.Execute()<br> --- End of inner exception stack trace ---<br> at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)<br> at System.Threading.Tasks.Task.Wait()<br> at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)<br><del>-</del>> (Inner Exception #0) ServiceStack.HttpError: Static File '/scripts/file.min.js' not found<br> at ServiceStack.Host.Handlers.StaticFileHandler.<>c__DisplayClass1.<ProcessRequest>b__0(IResponse r)<br> at ServiceStack.HttpExtensions.EndHttpHandlerRequest(IResponse httpRes, Boolean skipHeaders, Boolean skipClose, Action
1 afterHeaders)
at System.Threading.Tasks.Task.Execute()<—
ok cool, I’ll take a look - it should be returning 404.
Hi Jeff, it should be returning a 404 in the latest v4.0.35 on MyGet: https://github.com/ServiceStack/ServiceStack/wiki/MyGet