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