private static int GetStatusCode(OwsExceptionCodeEnum code)
        {
            switch (code)
            {
            case OwsExceptionCodeEnum.OperationNotSupported: return((int)HttpStatusCode.NotImplemented);

            case OwsExceptionCodeEnum.MissingParameterValue: return((int)HttpStatusCode.BadRequest);

            case OwsExceptionCodeEnum.InvalidParameterValue: return((int)HttpStatusCode.BadRequest);

            case OwsExceptionCodeEnum.VersionNegotiationFailed: return((int)HttpStatusCode.BadRequest);

            case OwsExceptionCodeEnum.InvalidUpdateSequence: return((int)HttpStatusCode.BadRequest);

            case OwsExceptionCodeEnum.OptionNotSupported: return((int)HttpStatusCode.InternalServerError);

            case OwsExceptionCodeEnum.NoApplicableCode: return((int)HttpStatusCode.InternalServerError);

            default: throw new ArgumentOutOfRangeException(nameof(code), code, "Unknown exceptionCode type");
            }
        }
Ejemplo n.º 2
0
 public OwsException(OwsExceptionCodeEnum code, string locator, string message)
     : this(code, locator, new[] { message })
 {
 }
Ejemplo n.º 3
0
 public OwsException(OwsExceptionCodeEnum code, string locator, string[] messages)
 {
     Code     = code;
     Locator  = locator;
     Messages = messages;
 }
Ejemplo n.º 4
0
 public OwsException(OwsExceptionCodeEnum code, string message)
     : this(code, null, message)
 {
 }