internal void OnAsyncException(Exception error)
{
if(!this.closed.Value && !this.closing.Value)
{
if(this.ExceptionListener != null)
{
if(!(error is NMSException))
{
error = NMSExceptionSupport.Create(error);
}
NMSException e = (NMSException)error;
// Called in another thread so that processing can continue
// here, ensures no lock contention.
executor.QueueUserWorkItem(AsyncCallExceptionListener, e);
}
else
{
Tracer.Debug("Async exception with no exception listener: " + error);
}
}
}