Jeff Gabhart - 194 - Dec 22, 2014

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>&nbsp; &nbsp;at System.Threading.Tasks.Task.Execute()<br>&nbsp; &nbsp;--- End of inner exception stack trace ---<br>&nbsp; &nbsp;at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)<br>&nbsp; &nbsp;at System.Threading.Tasks.Task.Wait()<br>&nbsp; &nbsp;at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)<br><del>-</del>&gt; (Inner Exception #0) ServiceStack.HttpError: Static File '/scripts/file.min.js' not found<br>&nbsp; &nbsp;at ServiceStack.Host.Handlers.StaticFileHandler.&lt;&gt;c__DisplayClass1.&lt;ProcessRequest&gt;b__0(IResponse r)<br>&nbsp; &nbsp;at ServiceStack.HttpExtensions.EndHttpHandlerRequest(IResponse httpRes, Boolean skipHeaders, Boolean skipClose, Action1 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