/// <summary> /// Initializes a new instance of the <see cref="PartnerRestExceptionRecord" /> class. /// </summary> /// <param name="exception">The error that occur during command execution.</param> /// <param name="record">The record of the error.</param> public PartnerRestExceptionRecord(PartnerException exception, ErrorRecord record) : base(exception, record) { if (exception != null) { //if (exception.Body != null) //{ // ServerMessage = string.Format($"{exception.Body.Code}: {exception.Body.Message} ({exception.Body.Details})"); //} if (exception.Response != null) { ServerResponse = new HttpResponseInfo(exception.Response); } if (exception.Request != null) { RequestMessage = new HttpRequestInfo(exception.Request); } CorrelationId = exception.Context.CorrelationId.ToString(); Locale = exception.Context.Locale; RequestId = exception.Context.RequestId.ToString(); } }
/// <summary> /// Initializes a new instance of the <see cref="PartnerRestExceptionRecord" /> class. /// </summary> /// <param name="exception">The error that occur during command execution.</param> /// <param name="record">The record of the error.</param> public PartnerRestExceptionRecord(PartnerException exception, ErrorRecord record) : base(exception, record) { if (exception != null) { if (exception.Response != null) { ServerResponse = new HttpResponseInfo(exception.Response); } if (exception.Request != null) { RequestMessage = new HttpRequestInfo(exception.Request); } CorrelationId = exception.Context.CorrelationId.ToString(); Locale = exception.Context.Locale; RequestId = exception.Context.RequestId.ToString(); } }