private void SafeNativeInvoke(Action<IModel> invokeAction)
{
try
{
if (!this.isClosed)
{
lock (this.sync)
invokeAction(this.Native);
}
}
catch (AlreadyClosedException ex)
{
Logger.Warn("Cought exception. Marking Channel as failed.", ex);
this.Failed(this, new ErrorEventArgs(ex));
}
catch (OperationInterruptedException ex)
{
Logger.Trace("Cought exception. Ignoring as part of shutdown process.", ex);
this.Failed(this, new ErrorEventArgs(ex));
}
}