Click or drag to resize
ISuppress Interface
Provides an interface to execute System.Actions without surfacing any exceptions raised for that action.

Namespace: NLog
Assembly: NLog (in NLog.dll) Version: 4.3.0
Syntax
public interface ISuppress
Methods
  NameDescription
Public methodSwallow(Action)
Runs the provided action. If the action throws, the exception is logged at Error level. The exception is not propagated outside of this method.
Public methodSwallow(Task)
Logs an exception is logged at Error level if the provided task does not run to completion.
Public methodSwallowT(FuncT)
Runs the provided function and returns its result. If an exception is thrown, it is logged at Error level. The exception is not propagated outside of this method; a default value is returned instead.
Public methodSwallowT(FuncT, T)
Runs the provided function and returns its result. If an exception is thrown, it is logged at Error level. The exception is not propagated outside of this method; a fallback value is returned instead.
Public methodSwallowAsync(FuncTask)
Runs async action. If the action throws, the exception is logged at Error level. The exception is not propagated outside of this method.
Public methodSwallowAsync(Task)
Returns a task that completes when a specified task to completes. If the task does not run to completion, an exception is logged at Error level. The returned task always runs to completion.
Public methodSwallowAsyncTResult(FuncTaskTResult)
Runs the provided async function and returns its result. If the task does not run to completion, an exception is logged at Error level. The exception is not propagated outside of this method; a default value is returned instead.
Public methodSwallowAsyncTResult(FuncTaskTResult, TResult)
Runs the provided async function and returns its result. If the task does not run to completion, an exception is logged at Error level. The exception is not propagated outside of this method; a fallback value is returned instead.
Top
See Also