Class AutomationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.jspinak.brobot.exception.AutomationException
All Implemented Interfaces:
Serializable

public class AutomationException extends RuntimeException
Exception thrown when automation sequences fail.

This exception provides structured information about automation failures, allowing applications to handle them appropriately based on configuration.

The exception can be caught and handled by applications to:

  • Log detailed failure information
  • Trigger recovery mechanisms
  • Continue with alternative automation paths
  • Perform cleanup operations
Since:
1.0
See Also:
  • Constructor Details

    • AutomationException

      public AutomationException(String message)
      Creates an automation exception with a message.
      Parameters:
      message - Error message
    • AutomationException

      public AutomationException(String message, Throwable cause)
      Creates an automation exception with a message and cause.
      Parameters:
      message - Error message
      cause - Underlying cause
    • AutomationException

      public AutomationException(String message, String stateName, String operation, boolean recoverable)
      Creates an automation exception with detailed context.
      Parameters:
      message - Error message
      stateName - Name of the state where failure occurred
      operation - Operation that failed (e.g., "transition", "click", "find")
      recoverable - Whether the error is potentially recoverable
    • AutomationException

      public AutomationException(String message, Throwable cause, String stateName, String operation, boolean recoverable)
      Creates an automation exception with detailed context and cause.
      Parameters:
      message - Error message
      cause - Underlying cause
      stateName - Name of the state where failure occurred
      operation - Operation that failed
      recoverable - Whether the error is potentially recoverable
  • Method Details

    • getStateName

      public String getStateName()
      Gets the name of the state where the failure occurred.
      Returns:
      State name, or null if not specified
    • getOperation

      public String getOperation()
      Gets the operation that failed.
      Returns:
      Operation name, or null if not specified
    • isRecoverable

      public boolean isRecoverable()
      Checks if the error is potentially recoverable.
      Returns:
      true if recoverable, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Throwable