Class SuppressionUtils

Namespace
Datamine.MineTrustConnector.Service.Extensibility
Assembly
Datamine.MineTrustConnector.Service.Extensibility.dll

Utility methods for handling exception instances.

public static class SuppressionUtils
Inheritance
SuppressionUtils
Inherited Members

Methods

ContainsAccessForbiddenError(Exception?)

Determines whether this Exception instance contains an error which was due to a MineTrust 'access forbidden' error.

public static bool ContainsAccessForbiddenError(this Exception? exception)

Parameters

exception Exception

The exception.

Returns

bool

true if [contains access forbidden error] [the specified exception]; otherwise, false.

SuppressWhen<TException>(Task, Func<TException, bool>)

Suppresses errors on the underlying action when a particular condition is met.

public static Task<SuppressionUtils.SuppressResult> SuppressWhen<TException>(this Task action, Func<TException, bool> suppressWhen) where TException : Exception

Parameters

action Task

The action.

suppressWhen Func<TException, bool>

The suppress when.

Returns

Task<SuppressionUtils.SuppressResult>

The result object indicating whether or not the action completed.

Type Parameters

TException

The type of the exception.

SuppressWhen<TException>(Task, Func<TException, Task<bool>>)

Suppresses errors on the underlying action when a particular condition is met.

public static Task<SuppressionUtils.SuppressResult> SuppressWhen<TException>(this Task action, Func<TException, Task<bool>> suppressWhen) where TException : Exception

Parameters

action Task

The action.

suppressWhen Func<TException, Task<bool>>

The suppress when.

Returns

Task<SuppressionUtils.SuppressResult>

The result object indicating whether or not the action completed.

Type Parameters

TException

The type of the exception.

SuppressWhen<TException, TResult>(Task<TResult>, Func<TException, bool>)

Suppresses errors on the underlying action when a particular condition is met.

public static Task<SuppressionUtils.SuppressResult<TResult>> SuppressWhen<TException, TResult>(this Task<TResult> action, Func<TException, bool> suppressWhen) where TException : Exception

Parameters

action Task<TResult>

The action.

suppressWhen Func<TException, bool>

The suppress when.

Returns

Task<SuppressionUtils.SuppressResult<TResult>>

The result object indicating whether or not the action completed, and the result if it did.

Type Parameters

TException

The type of the exception.

TResult

The type of the result.

SuppressWhen<TException, TResult>(Task<TResult>, Func<TException, Task<bool>>)

Suppresses errors on the underlying action when a particular condition is met.

public static Task<SuppressionUtils.SuppressResult<TResult>> SuppressWhen<TException, TResult>(this Task<TResult> action, Func<TException, Task<bool>> suppressWhen) where TException : Exception

Parameters

action Task<TResult>

The action.

suppressWhen Func<TException, Task<bool>>

The suppress when.

Returns

Task<SuppressionUtils.SuppressResult<TResult>>

The result object indicating whether or not the action completed, and the result if it did.

Type Parameters

TException

The type of the exception.

TResult

The type of the result.