protected void SetResponseError(HttpListenerContext context, int code, string message)
{
Platform.CheckForNullReference(context, "Context");
try
{
Platform.Log(LogLevel.Error, "Streaming Error: {0} {1}", code, message);
context.Response.StatusCode = code;
context.Response.StatusDescription = HttpUtility.HtmlEncode(message);
}
catch(Exception)
{
// probably caused by the control characters in the message.
// just ignore it
}
}