Class AutomationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.jspinak.brobot.exception.AutomationException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionAutomationException
(String message) Creates an automation exception with a message.AutomationException
(String message, String stateName, String operation, boolean recoverable) Creates an automation exception with detailed context.AutomationException
(String message, Throwable cause) Creates an automation exception with a message and cause.AutomationException
(String message, Throwable cause, String stateName, String operation, boolean recoverable) Creates an automation exception with detailed context and cause. -
Method Summary
Modifier and TypeMethodDescriptionGets the operation that failed.Gets the name of the state where the failure occurred.boolean
Checks if the error is potentially recoverable.toString()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
AutomationException
Creates an automation exception with a message.- Parameters:
message
- Error message
-
AutomationException
Creates an automation exception with a message and cause.- Parameters:
message
- Error messagecause
- Underlying cause
-
AutomationException
Creates an automation exception with detailed context.- Parameters:
message
- Error messagestateName
- Name of the state where failure occurredoperation
- 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 messagecause
- Underlying causestateName
- Name of the state where failure occurredoperation
- Operation that failedrecoverable
- Whether the error is potentially recoverable
-
-
Method Details
-
getStateName
Gets the name of the state where the failure occurred.- Returns:
- State name, or null if not specified
-
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
-