TimeoutExceptionExtensions Class
Provides ThrowNew extension methods for TimeoutException.
public static class TimeoutExceptionExtensionsRemarks
Each public constructor of the exception type has two methods, with the parameters of the constructor. Call them on the exception type, as in TimeoutException.ThrowNew(message).
The first method returns no value. Call it as a statement.
The second method has a type parameter, which is also its return type. Call it where the code needs an expression of that type.
See also
Methods
| Name | Description |
|---|---|
| TimeoutException.ThrowNew() | Throws a new TimeoutException. |
| TimeoutException.ThrowNew(string?) | Throws a new TimeoutException. |
| TimeoutException.ThrowNew(string?, Exception?) | Throws a new TimeoutException. |
| TimeoutException.ThrowNew<T>() | Throws a new TimeoutException, where the code needs an expression of type T. |
| TimeoutException.ThrowNew<T>(string?) | Throws a new TimeoutException, where the code needs an expression of type T. |
| TimeoutException.ThrowNew<T>(string?, Exception?) | Throws a new TimeoutException, where the code needs an expression of type T. |
TimeoutException.ThrowNew overloads
TimeoutException.ThrowNew()
Throws a new TimeoutException.
extension(TimeoutException)
{
public static void ThrowNew()
}TimeoutException.ThrowNew(string?)
Throws a new TimeoutException.
extension(TimeoutException)
{
public static void ThrowNew(string? message)
}Parameters
messagestring?- The message that describes the error.
TimeoutException.ThrowNew(string?, Exception?)
Throws a new TimeoutException.
extension(TimeoutException)
{
public static void ThrowNew(string? message, Exception? innerException)
}Parameters
messagestring?- The message that describes the error.
innerExceptionException?- The exception that is the cause of the current exception. If the
innerExceptionparameter is notnull, the current exception is raised in acatchblock that handles the inner exception.
TimeoutException.ThrowNew<T>()
Throws a new TimeoutException, where the code needs an expression of type T.
extension(TimeoutException)
{
public static T ThrowNew<T>()
}Type parameters
T- The type of the expression.
Returns
T This method does not return.
TimeoutException.ThrowNew<T>(string?)
Throws a new TimeoutException, where the code needs an expression of type T.
extension(TimeoutException)
{
public static T ThrowNew<T>(string? message)
}Type parameters
T- The type of the expression.
Parameters
messagestring?- The message that describes the error.
Returns
T This method does not return.
TimeoutException.ThrowNew<T>(string?, Exception?)
Throws a new TimeoutException, where the code needs an expression of type T.
extension(TimeoutException)
{
public static T ThrowNew<T>(string? message, Exception? innerException)
}Type parameters
T- The type of the expression.
Parameters
messagestring?- The message that describes the error.
innerExceptionException?- The exception that is the cause of the current exception. If the
innerExceptionparameter is notnull, the current exception is raised in acatchblock that handles the inner exception.
Returns
T This method does not return.