/// <summary>
        /// Handles exceptions caught by main event processing loop.
        /// </summary>
        /// <param name="exception">The exception caught.</param>
        protected void handleException(Exception exception)
        {
            NSFExceptionContext newContext = new NSFExceptionContext(this, new Exception(Name + " thread exception", exception));

            ExceptionActions.execute(newContext);
            NSFExceptionHandler.handleException(newContext);
        }
示例#2
0
        /// <summary>
        /// Handles exceptions raised during state machine processing.
        /// </summary>
        /// <param name="exception">The exception thrown.</param>
        /// <remarks>
        /// By default, any exception actions are executed first,
        /// then the exception is forwarded to the global exception handler, NSFExceptionHandler.handleException().
        /// </remarks>
        protected internal void handleException(Exception exception)
        {
            NSFExceptionContext newContext = new NSFExceptionContext(this, new Exception(Name + " state machine exception", exception));

            ExceptionActions.execute(newContext);
            NSFExceptionHandler.handleException(newContext);
        }
示例#3
0
 /// <summary>
 /// Executes the thread execution action.
 /// </summary>
 /// <remarks>
 /// The thread execution action is typically an execution loop.
 /// When the action returns, the thread is terminated.
 /// Derived classes should call this method from their thread entry method.
 /// This method should not be called in any other circumnstances.
 /// </remarks>
 public void executeAction()
 {
     try
     {
         action(new NSFContext(this));
     }
     catch (Exception exception)
     {
         Exception newException = new Exception(Name + " thread execution action exception", exception);
         NSFExceptionHandler.handleException(new NSFExceptionContext(this, newException));
     }
 }
示例#4
0
        /// <summary>
        /// Handles exceptions caught during action execution.
        /// </summary>
        /// <param name="context">Additional contextual information.</param>
        private void handleActionException(NSFExceptionContext context)
        {
            Exception newException = new Exception(Name + " action exception", context.Exception);

            NSFExceptionHandler.handleException(new NSFExceptionContext(this, newException));
        }
        /// <summary>
        /// Handles exceptions raised during processing.
        /// </summary>
        /// <param name="exception">The exception thrown.</param>
        /// <remarks>
        /// The exception is forwarded to the global exception handler, NSFExceptionHandler.handleException().
        /// </remarks>
        private void handleException(Exception exception)
        {
            NSFExceptionContext newContext = new NSFExceptionContext(this, new Exception(Name + " event handler exception", exception));

            NSFExceptionHandler.handleException(newContext);
        }