Class ExceptionExtensions
Provides extension methods for
Inherited Members
Namespace: Swan
Syntax
public static class ExceptionExtensions
Methods
IsCriticalException(Exception)
Returns a value that tells whether an
Declaration
public static bool IsCriticalException(this Exception this)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | this | The exception being thrown. |
Returns
| Type | Description |
|---|---|
| Boolean | true if |
IsFatalException(Exception)
Returns a value that tells whether an
Declaration
public static bool IsFatalException(this Exception this)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | this | The exception being thrown. |
Returns
| Type | Description |
|---|---|
| Boolean | true if |
RethrowPreservingStackTrace(Exception)
Rethrows an already-thrown exception, preserving the stack trace of the original throw.
This method does not return; its return type is an exception type so it can be used
with throw semantics, e.g.: throw ex.RethrowPreservingStackTrace();,
to let static code analysis tools that it throws instead of returning.
Declaration
public static InternalErrorException RethrowPreservingStackTrace(this Exception this)
Parameters
| Type | Name | Description |
|---|---|---|
| Exception | this | The exception to rethrow. |
Returns
| Type | Description |
|---|---|
| InternalErrorException | This method should never return; if it does, it is an indication of an internal error, so it returns an instance of InternalErrorException. |