Volume Control
Application-specific hotkeys for Windows
|
Helper methods for converting exceptions into nicely formatted strings. More...
Public Types | |
enum class | MessageParts { None = 0 , Message = 1 , HResult = 2 , ExceptionType = 4 , HelpLink = 8 , CustomProperties = 16 , Source = 32 , TargetSite = 64 , Data = 128 , StackTrace = 256 , InnerException = 512 , All = Message | HResult | ExceptionType | HelpLink | CustomProperties | Source | TargetSite | Data | StackTrace | InnerException } |
Defines the sections in a formatted exception message string. More... | |
Static Public Member Functions | |
static string | MakeExceptionMessage (Exception exception, string linePrefix, string endline, int tabLength, MessageParts includedParts) |
Creates a nicely-formatted exception message from the specified exception object. More... | |
static string | MakeExceptionMessage (Exception exception, string linePrefix="", int tabLength=2, MessageParts includedParts=MessageParts.All) |
static string | MakeSerialExceptionMessage (Exception exception, MessageParts includedParts=MessageParts.All) |
Creates a single-line exception message from the specified exception object. More... | |
Helper methods for converting exceptions into nicely formatted strings.
This is used internally by AsyncLogWriter to format exceptions.
Defines the sections in a formatted exception message string.
Enumerator | |
---|---|
None | Nothing. |
Message | The Exception.Message property. |
HResult | The Exception.HResult property. |
ExceptionType | The Type of the exception object. |
HelpLink | The Exception.HelpLink property. |
CustomProperties | Properties defined in derived exception objects. |
Source | The Exception.Source property. |
TargetSite | The Exception.TargetSite property. |
Data | The Exception.Data property. |
StackTrace | The Exception.StackTrace property. |
InnerException | The Exception.InnerException property. |
All | All other values in the MessageParts enumeration. |
|
static |
Creates a nicely-formatted exception message from the specified exception object.
exception | Exception object to create a message for. |
linePrefix | string prefix inserted before every line except for the first one. |
endline | string suffix appended to every line except for the last one. |
tabLength | The number of spaces to use for each tab character. |
includedParts | Value(s) from the MessageParts enumeration that determines what is included in the message. |
ArgumentNullException | exception was null . |
|
static |
Creates a single-line exception message from the specified exception object.