ClearCanvas.ImageServer.Services.Streaming.Shreds.ImageStreamingServer.SetResponseError C# (CSharp) Method

SetResponseError() protected method

protected SetResponseError ( HttpListenerContext context, int code, string message ) : void
context System.Net.HttpListenerContext
code int
message string
return void
        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
            }
	    }