/// <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); }
static void globalHandleException(NSFExceptionContext context) { if (!context.Exception.ToString().Contains(ExceptionHandlingTest.IntentionalExceptionString)) { NSFDebugUtility.PrimaryDebugUtility.writeLineToConsole("Global exception caught: " + context.Exception.ToString()); } }
/// <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); }
/// <summary> /// Global exception handling method. /// </summary> /// <param name="context">Additional contextual information.</param> /// <remarks> /// All exceptions are ultimately routed to this method. It logs the exception to the trace log, /// saves the trace log if a file name has been set, and executes any exception actions. /// </remarks> public static void handleException(NSFExceptionContext context) { try { NSFTraceLog.PrimaryTraceLog.addTrace(NSFTraceTags.ExceptionTag, NSFTraceTags.MessageTag, context.Exception.ToString()); } catch (Exception) { // Nothing to do } ExceptionActions.execute(context); }
/// <summary> /// Handles exceptions caught while executing state change actions. /// </summary> /// <param name="context">Additional contextual information.</param> private void handleStateChangeActionException(NSFExceptionContext context) { handleException(new Exception("State change action exception", context.Exception)); }
/// <summary> /// Handles an exception caught while executing time gap actions. /// </summary> /// <param name="context">The exception context.</param> private void handleTimeGapActionException(NSFExceptionContext context) { handleException(new Exception(Name + " time gap action exception", context.Exception)); }
/// <summary> /// Handles exceptions caught while executing event actions. /// </summary> /// <param name="context">Additional contextual information.</param> private void handleEventReactionException(NSFExceptionContext context) { handleException(new Exception("Event reaction exception", context.Exception)); }
private void localHandleException(NSFExceptionContext context) { event2.queueEvent(); }
/// <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 an exception that occured while evaluating a transition guard. /// </summary> /// <param name="context">The exception context.</param> private void handleGuardException(NSFExceptionContext context) { Source.TopStateMachine.handleException(new Exception(Name + " transition guard exception", context.Exception)); }
/// <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); }
/// <summary> /// Handles exceptions caught while executing exit actions. /// </summary> /// <param name="context">Additional contextual information.</param> private void handleExitActionException(NSFExceptionContext context) { TopStateMachine.handleException(new Exception(Name + " state exit action exception", context.Exception)); }