The ErrorBarrier is a helper class that executes the specified method and catches all thrown exceptions, wrapping them in an TinmanError object.
static class
|
ErrorBarrier
|
with
|
<T>
|
Invokes the given delegate method, catches any thrown exception and returns an TinmanError object that describes the thrown exception.
public
static
method
|
Run
(string source,
ErrorBarrierDelegate<T> method,
T argument)
|
||
type
|
TinmanError
|
||
params
|
source
|
[not-empty]
|
The error source to use in case an exception is thrown. |
method
|
[not-null]
|
The delegate method. | |
argument
|
Optional argument value. | ||
returns
|
null
if
the
called
method
returned
without
throwing
an
exception,
the
error
message
describing
the
thrown
exception
otherwise.
|