private static string GetMessage(StreamingClientExceptionType type) { switch (type) { case StreamingClientExceptionType.Server: return("A server error has occurred while streaming the image."); case StreamingClientExceptionType.Network: return("A network error has occurred while streaming the image."); case StreamingClientExceptionType.Protocol: return("A protocol error has occurred while streaming the image."); case StreamingClientExceptionType.Access: return("An access error has occurred while streaming the image."); case StreamingClientExceptionType.UnexpectedResponse: return("An unexpected response was received while streaming the image."); case StreamingClientExceptionType.Generic: default: return("An error has occurred while streaming the image."); } }
internal StreamingClientException(HttpStatusCode httpStatusCode, string httpStatusDescription) : base(GetMessage(ClassifyHttpStatusCode(httpStatusCode)), ConstructHttpInnerException(httpStatusCode, httpStatusDescription)) { this.Type = ClassifyHttpStatusCode(httpStatusCode); this.HttpStatusCode = (int)httpStatusCode; }
internal StreamingClientException(StreamingClientExceptionType type, Exception innerException) : base(GetMessage(type), innerException) { this.Type = type; this.HttpStatusCode = -1; }
internal StreamingClientException(HttpStatusCode httpStatusCode, string httpStatusDescription) : base(GetMessage(ClassifyHttpStatusCode(httpStatusCode)), ConstructHttpInnerException(httpStatusCode, httpStatusDescription)) { this.Type = ClassifyHttpStatusCode(httpStatusCode); this.HttpStatusCode = (int) httpStatusCode; }
private static string GetMessage(StreamingClientExceptionType type) { switch (type) { case StreamingClientExceptionType.Server: return "A server error has occurred while streaming the image."; case StreamingClientExceptionType.Network: return "A network error has occurred while streaming the image."; case StreamingClientExceptionType.Protocol: return "A protocol error has occurred while streaming the image."; case StreamingClientExceptionType.Access: return "An access error has occurred while streaming the image."; case StreamingClientExceptionType.UnexpectedResponse: return "An unexpected response was received while streaming the image."; case StreamingClientExceptionType.Generic: default: return "An error has occurred while streaming the image."; } }