public static string GetExceptionMessage(this HttpRequestMessage request, Exception exception = null, string prefix = null) { var metadata = new ExceptionResponseMetadata(); metadata.Apply(request); return(GetExceptionMessage(metadata, prefix, null, exception?.Message)); }
public static string GetExceptionMessage(this HttpResponseMessage response, HttpRequestMessage request, Exception exception = null, string prefix = null, string reason = null) { if (response == null) { return(string.Empty); } var metadata = new ExceptionResponseMetadata(); metadata.Apply(response); metadata.Apply(request); return(GetExceptionMessage(metadata, prefix, reason, exception?.Message)); }