示例#1
0
        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");
            }
        }
示例#2
0
 public OwsException(OwsExceptionCode code, string message, Exception innerException) :
     base(string.IsNullOrEmpty(message) ? _GetMessageFromCode(code) : message, innerException)
 {
     Data[_CodeKey] = code;
 }
示例#3
0
 public OwsException(OwsExceptionCode code, Exception innerException) :
     this(code, _GetMessageFromCode(code), innerException)
 {
 }
示例#4
0
 public OwsException(OwsExceptionCode code) :
     this(code, _GetMessageFromCode(code))
 {
 }
示例#5
0
 public OwsException(OwsExceptionCode code, string message, Exception innerException):
     base(string.IsNullOrEmpty(message) ? _GetMessageFromCode(code) : message, innerException)
 {
     Data[_CodeKey]=code;
 }
示例#6
0
 public OwsException(OwsExceptionCode code, Exception innerException):
     this(code, _GetMessageFromCode(code), innerException)
 {}
示例#7
0
 public OwsException(OwsExceptionCode code):
     this(code, _GetMessageFromCode(code))
 {}
示例#8
0
 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";
     }
 }