aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs3
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs6
2 files changed, 8 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
index 961d58eb6..9dc8d94e2 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
@@ -476,7 +476,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer
return new StreamWriter(stream, contentType, _logger)
{
- OnComplete = options.OnComplete
+ OnComplete = options.OnComplete,
+ OnError = options.OnError
};
}
diff --git a/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs b/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs
index daa5b86d9..a756f4aa8 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/StreamWriter.cs
@@ -36,6 +36,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
}
public Action OnComplete { get; set; }
+ public Action OnError { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="StreamWriter" /> class.
@@ -102,6 +103,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer
{
Logger.ErrorException("Error streaming data", ex);
+ if (OnError != null)
+ {
+ OnError();
+ }
+
throw;
}
finally