/// <inheritdoc /> protected override Task <Exception> GetDefaultException( RequestContent requestContent, ResponseContent responseContent, HttpResponseExceptionContext context) { var stringBuilder = new StringBuilder(); stringBuilder.AppendLine("There was an unexpected response."); stringBuilder.AppendLine("Response:"); stringBuilder.AppendLine(responseContent.ToString()); stringBuilder.AppendLine("Request:"); stringBuilder.AppendLine(requestContent.ToString()); var exceptionMessage = context.Formatter.Message(stringBuilder.ToString()); return(Task.FromResult(new Exception(exceptionMessage))); }
/// <summary> /// Gets the default exception. /// </summary> /// <param name="requestContent">Content of the request.</param> /// <param name="responseContent">Content of the response.</param> /// <param name="context">The context.</param> /// <returns>The default exception.</returns> protected abstract Task <Exception> GetDefaultException( RequestContent requestContent, ResponseContent responseContent, HttpResponseExceptionContext context);