Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }