NServiceBus.ExceptionExtensions.GetMessage C# (CSharp) Method

GetMessage() public static method

public static GetMessage ( this exception ) : string
exception this
return string
        public static string GetMessage(this Exception exception)
        {
            try
            {
                return exception.Message;
            }
            catch (Exception)
            {
                return $"Could not read Message from exception type '{exception.GetType()}'.";
            }
        }
    }
ExceptionExtensions