aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-03-11 22:38:27 -0400
committerLukePulverenti <luke.pulverenti@gmail.com>2013-03-11 22:38:27 -0400
commitdad41a224f7b2e36519743ef9e7e7c6692200e5d (patch)
treefe5ccdfdeb8a6e3455381fe19e9c7e6b92290b01 /MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
parentdf757416b79b3aa3f83ff00bab9a7e363aa1cc41 (diff)
fixes #28 - Better info error when adding same path to media collection
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
index ee5009e21..0fc2c0dda 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
@@ -142,9 +142,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
DefaultRedirectPath = DefaultRedirectPath,
// Tell SS to bubble exceptions up to here
- WriteErrorsToResponse = false,
-
- DebugMode = true
+ WriteErrorsToResponse = false
});
container.Adapter = new ContainerAdapter(ApplicationHost);
@@ -153,6 +151,21 @@ namespace MediaBrowser.Server.Implementations.HttpServer
Plugins.Add(new CorsFeature());
ServiceStack.Logging.LogManager.LogFactory = new NLogFactory();
+
+ ResponseFilters.Add((req, res, dto) =>
+ {
+ var exception = dto as Exception;
+
+ if (exception != null)
+ {
+ _logger.ErrorException("Error processing request", exception);
+
+ if (!string.IsNullOrEmpty(exception.Message))
+ {
+ res.AddHeader("X-Application-Error-Code", exception.Message);
+ }
+ }
+ });
}
/// <summary>