Amazon.ElasticLoadBalancingV2.Model.Internal.MarshallTransformations.RegisterTargetsResponseUnmarshaller.UnmarshallException C# (CSharp) Метод

UnmarshallException() публичный Метод

Unmarshaller error response to exception.
public UnmarshallException ( Amazon.Runtime.Internal.Transform.XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode ) : AmazonServiceException
context Amazon.Runtime.Internal.Transform.XmlUnmarshallerContext
innerException System.Exception
statusCode HttpStatusCode
Результат Amazon.Runtime.AmazonServiceException
        public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
        {
            ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
            if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidTarget"))
            {
                return new InvalidTargetException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("TargetGroupNotFound"))
            {
                return new TargetGroupNotFoundException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyRegistrationsForTargetId"))
            {
                return new TooManyRegistrationsForTargetIdException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("TooManyTargets"))
            {
                return new TooManyTargetsException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            return new AmazonElasticLoadBalancingV2Exception(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
        }
        private static RegisterTargetsResponseUnmarshaller _instance = new RegisterTargetsResponseUnmarshaller();