better progress display

This commit is contained in:
Luke Pulverenti 2013-04-15 22:36:12 -04:00
parent 540fb09f39
commit f1dba04767

View File

@ -284,56 +284,45 @@ namespace MediaBrowser.Server.Implementations.HttpServer
RaiseReceiveWebRequest(context); RaiseReceiveWebRequest(context);
try await Task.Run(() =>
{ {
ProcessRequest(context); try
} {
catch (InvalidOperationException ex) ProcessRequest(context);
{ }
HandleException(context.Response, ex, 422); catch (InvalidOperationException ex)
{
throw; HandleException(context.Response, ex, 422);
} }
catch (ResourceNotFoundException ex) catch (ResourceNotFoundException ex)
{ {
HandleException(context.Response, ex, 404); HandleException(context.Response, ex, 404);
}
throw; catch (FileNotFoundException ex)
} {
catch (FileNotFoundException ex) HandleException(context.Response, ex, 404);
{ }
HandleException(context.Response, ex, 404); catch (DirectoryNotFoundException ex)
{
throw; HandleException(context.Response, ex, 404);
} }
catch (DirectoryNotFoundException ex) catch (UnauthorizedAccessException ex)
{ {
HandleException(context.Response, ex, 404); HandleException(context.Response, ex, 401);
}
throw; catch (ArgumentException ex)
} {
catch (UnauthorizedAccessException ex) HandleException(context.Response, ex, 400);
{ }
HandleException(context.Response, ex, 401); catch (Exception ex)
{
throw; HandleException(context.Response, ex, 500);
} }
catch (ArgumentException ex) finally
{ {
HandleException(context.Response, ex, 400); context.Response.Close();
}
throw; }).ConfigureAwait(false);
}
catch (Exception ex)
{
HandleException(context.Response, ex, 500);
throw;
}
finally
{
context.Response.Close();
}
} }
/// <summary> /// <summary>