aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-07-03 22:22:57 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-07-03 22:22:57 -0400
commit7fa9b14f56eabbb06e38726879b3cddc47b8e8fb (patch)
tree68c33977dc4f71cb3decae62c071887b9f914fc1 /MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
parent59dc591f66c20b6417aa2baa9503a154585386f9 (diff)
fixes #762 - Marking unwatched doesn't update display
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs26
1 files changed, 16 insertions, 10 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
index 833dfc5e4..cfcbb077e 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -363,19 +363,15 @@ namespace MediaBrowser.Server.Implementations.HttpServer
{
try
{
- var errorResponse = new ErrorResponse
- {
- ResponseStatus = new ResponseStatus
- {
- ErrorCode = ex.GetType().GetOperationName(),
- Message = ex.Message,
- StackTrace = ex.StackTrace,
- }
- };
-
var operationName = context.Request.GetOperationName();
var httpReq = GetRequest(context, operationName);
var httpRes = httpReq.Response;
+
+ if (httpRes.IsClosed)
+ {
+ return;
+ }
+
var contentType = httpReq.ResponseContentType;
var serializer = HostContext.ContentTypes.GetResponseSerializer(contentType);
@@ -398,6 +394,16 @@ namespace MediaBrowser.Server.Implementations.HttpServer
httpRes.ContentType = contentType;
+ var errorResponse = new ErrorResponse
+ {
+ ResponseStatus = new ResponseStatus
+ {
+ ErrorCode = ex.GetType().GetOperationName(),
+ Message = ex.Message,
+ StackTrace = ex.StackTrace,
+ }
+ };
+
serializer(httpReq, errorResponse, httpRes);
httpRes.Close();