Amazon.DatabaseMigrationService.Model.Internal.MarshallTransformations.CreateReplicationTaskResponseUnmarshaller.UnmarshallException C# (CSharp) 메소드

UnmarshallException() 공개 메소드

Unmarshaller error response to exception.
public UnmarshallException ( JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode ) : AmazonServiceException
context Amazon.Runtime.Internal.Transform.JsonUnmarshallerContext
innerException System.Exception
statusCode HttpStatusCode
리턴 Amazon.Runtime.AmazonServiceException
        public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
        {
            ErrorResponse errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
            if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidResourceStateFault"))
            {
                return new InvalidResourceStateException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("KMSKeyNotAccessibleFault"))
            {
                return new KMSKeyNotAccessibleException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceAlreadyExistsFault"))
            {
                return new ResourceAlreadyExistsException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundFault"))
            {
                return new ResourceNotFoundException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceQuotaExceededFault"))
            {
                return new ResourceQuotaExceededException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            return new AmazonDatabaseMigrationServiceException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
        }
CreateReplicationTaskResponseUnmarshaller