Ejemplo n.º 1
0
        /// <summary>
        /// Initializes exception with information available from the service plus from an exception
        /// Needed for backwards compatibility
        /// </summary>
        /// <param name="statusCode">HTTP status code for error response (as an int)</param>
        /// <param name="message">Error message from HTTP header</param>
        /// <param name="errorCode">Error code from response XML</param>
        /// <param name="errorType">Error type from response XML</param>
        /// <param name="xml">Compete XML found in response</param>
        /// <param name="rhmd">Response header information</param>
        /// <param name="cause">Wrapped exception</param>
        public MwsException(int statusCode, string message, string errorCode, string errorType, string xml, MwsResponseHeaderMetadata rhmd, Exception cause)
            : base()
        {
            this.statusCode = statusCode;
            this.rhmd = rhmd;
            this.xml = xml;
            this.errorType = errorType;
            this.errorCode = errorCode;
            this.message = message;

            if (xml != null)
            {
                this.populateFromXML(xml);
            }

            if (cause is MwsException)
            {
                this.populateFromMWSException((MwsException)cause);
            }
        }
 public MwsResponseHeaderMetadata(MwsResponseHeaderMetadata rhmd)
     : this(rhmd.RequestId, rhmd.ResponseContext, rhmd.Timestamp, rhmd.QuotaMax, rhmd.QuotaRemaining, rhmd.QuotaResetsAt)
 {
 }
Ejemplo n.º 3
0
 private void populateFromMWSException( MwsException e )
 {
     if (e.StatusCode != null) this.statusCode = (int)e.StatusCode;
     if (e.Message != null) this.message = e.Message;
     if (e.errorCode != null) this.errorCode = e.ErrorCode;
     if (e.errorType != null) this.errorType = e.ErrorType;
     if (e.detail != null) this.detail = e.Detail;
     if (e.xml != null) this.xml = e.XML;
     if (e.ResponseHeaderMetadata != null) this.rhmd = e.ResponseHeaderMetadata;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes exception with information available from the service
 /// </summary>
 /// <param name="statusCode">HTTP status code for error response (as an int)</param>
 /// <param name="message">Error message from HTTP header</param>
 /// <param name="errorCode">Error code from response XML</param>
 /// <param name="errorType">Error type from response XML</param>
 /// <param name="xml">Compete XML found in response</param>
 /// <param name="rhmd">Response header information</param>
 public MwsException(int statusCode, string message, string errorCode, string errorType, string xml, MwsResponseHeaderMetadata rhmd)
     : this(statusCode, message, errorCode, errorType, xml, rhmd, null)
 {
 }
 public ResponseHeaderMetadata(MwsResponseHeaderMetadata rhmd)
     : base(rhmd)
 {
 }