public static GetInstance ( |
||
e | ||
return |
public static Exception /*!*/ InitializeException(Exception /*!*/ exception, object message) { // only set it if message is non-null. Otherwise, let lazy initialization create the default message from CLR exception message if (message != null) { RubyExceptionData.GetInstance(exception).Message = message; } return(exception); }
public static void ActiveExceptionHandled(Exception visibleException) { Debug.Assert(RubyUtils.GetVisibleException(visibleException) == visibleException); RubyExceptionData data = RubyExceptionData.GetInstance(visibleException); if (data._exception != visibleException) { // The exception was raised asynchronously with Thread.Abort. We can not just catch and ignore // the ThreadAbortException as the CLR keeps trying to re-raise it unless ResetAbort is called. // // Note that ResetAbort can cause ThreadAbortException.ExceptionState to be cleared (though it may // not be cleared under some circustances), and we use that to squirrel away the Ruby exception // that the user is expecting. Hence, ResetAbort should only be called when // ThreadAbortException.ExceptionState no longer needs to be accessed. if ((Thread.CurrentThread.ThreadState & System.Threading.ThreadState.AbortRequested) != 0) { Thread.ResetAbort(); } } }