ObjectExceptionHelper Class
Namespace: PTS
Assembly: PTSframework.dll
Generic object helper class with methods to throw contextual exceptions.
Syntax
public static class ObjectExceptionHelper
Inheritance
Methods
Exception<TException>(Object, Action, String)
Throws specified exception type with contextual message for calling object.
Declaration
public static TException Exception<TException>(this object thrower, Action throwerMethod, string message)
where TException : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Object | thrower | Object that trows the exception. |
System.Action | throwerMethod | Source method in thrower to be included in the message. |
System.String | message | Human readable message explaining the detials of the exception. |
Returns
Type | Description |
---|---|
TException |
Type Parameters
Name | Description |
---|---|
TException | Type of exception to throw. |
Exceptions
Type | Condition |
---|---|
System.Exception | Always thrown to terminate current runtime execution with specified message. |
Exception<TException>(Object, String)
Throws specified exception type with contextual message for calling object.
Declaration
public static TException Exception<TException>(this object thrower, string message)
where TException : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Object | thrower | Object that trows the exception. |
System.String | message | Human readable message explaining the detials of the exception. |
Returns
Type | Description |
---|---|
TException |
Type Parameters
Name | Description |
---|---|
TException | Type of exception to throw. |
Exceptions
Type | Condition |
---|---|
System.Exception | Always thrown to terminate current runtime execution with specified message. |
Exception<TException>(String)
Throws specified exception type with message.
Declaration
public static TException Exception<TException>(string message)
where TException : Exception
Parameters
Type | Name | Description |
---|---|---|
System.String | message | Human readable message explaining the detials of the exception. |
Returns
Type | Description |
---|---|
TException |
Type Parameters
Name | Description |
---|---|
TException | Type of exception to throw. |
Exceptions
Type | Condition |
---|---|
System.Exception | Always thrown to terminate current runtime execution with specified message. |