private static string _GetMessageFromCode(OwsExceptionCode code) { switch (code) { case OwsExceptionCode.InvalidParameterValue: return("Invalid parameter value"); case OwsExceptionCode.InvalidUpdateSequence: return("Invalid update sequence"); case OwsExceptionCode.MissingParameterValue: return("Missing parameter"); case OwsExceptionCode.OperationNotSupported: return("Operation not supported"); case OwsExceptionCode.OptionNotSupported: return("Option not supported"); case OwsExceptionCode.VersionNegotiationFailed: return("Version negotiation failed"); default: return("Internal server error"); } }
public OwsException(OwsExceptionCode code, string message, Exception innerException) : base(string.IsNullOrEmpty(message) ? _GetMessageFromCode(code) : message, innerException) { Data[_CodeKey] = code; }
public OwsException(OwsExceptionCode code, Exception innerException) : this(code, _GetMessageFromCode(code), innerException) { }
public OwsException(OwsExceptionCode code) : this(code, _GetMessageFromCode(code)) { }
public OwsException(OwsExceptionCode code, string message, Exception innerException): base(string.IsNullOrEmpty(message) ? _GetMessageFromCode(code) : message, innerException) { Data[_CodeKey]=code; }
public OwsException(OwsExceptionCode code, Exception innerException): this(code, _GetMessageFromCode(code), innerException) {}
public OwsException(OwsExceptionCode code): this(code, _GetMessageFromCode(code)) {}
private static string _GetMessageFromCode(OwsExceptionCode code) { switch (code) { case OwsExceptionCode.InvalidParameterValue: return "Invalid parameter value"; case OwsExceptionCode.InvalidUpdateSequence: return "Invalid update sequence"; case OwsExceptionCode.MissingParameterValue: return "Missing parameter"; case OwsExceptionCode.OperationNotSupported: return "Operation not supported"; case OwsExceptionCode.OptionNotSupported: return "Option not supported"; case OwsExceptionCode.VersionNegotiationFailed: return "Version negotiation failed"; default: return "Internal server error"; } }