Class LauncherException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.botwithus.bot.api.script.LauncherException
- All Implemented Interfaces:
Serializable
A
ClientLauncher call that failed. code() is a stable
snake_case identifier and is what to branch on; the message is English for
logs and is never parsed.
Most codes come from the launcher service. SERVICE_UNAVAILABLE and
SERVICE_STOPPED are raised by the host when no service answered.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringNo account has that id.static final StringNo client has that id.static final StringThe call is outside this script's targets, or not allowed on this surface.static final StringThe automation launch budget is spent; seeretryAfterMs().static final StringThe user stopped the service from the tray.static final StringNo service is reachable, or it did not answer in time. -
Constructor Summary
ConstructorsConstructorDescriptionLauncherException(String code, String message) LauncherException(String code, String message, boolean isRetryable, OptionalLong retryAfterMs, Optional<String> field) LauncherException(String code, String message, Throwable cause) -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
SERVICE_UNAVAILABLE
No service is reachable, or it did not answer in time. Retry later.- See Also:
-
SERVICE_STOPPED
The user stopped the service from the tray. The host will not start it.- See Also:
-
NOT_PERMITTED
The call is outside this script's targets, or not allowed on this surface.- See Also:
-
RATE_LIMITED
The automation launch budget is spent; seeretryAfterMs().- See Also:
-
ACCOUNT_NOT_FOUND
-
CLIENT_NOT_FOUND
-
-
Constructor Details
-
LauncherException
-
LauncherException
public LauncherException(String code, String message, boolean isRetryable, OptionalLong retryAfterMs, Optional<String> field) - Parameters:
code- the wire or host codemessage- English text for logsisRetryable- whether the service said a retry may succeedretryAfterMs- forrate_limited, how long to waitfield- forbad_request, the offending field
-
LauncherException
-
-
Method Details
-
code
- Returns:
- the stable code, for example
"rate_limited"
-
isRetryable
public boolean isRetryable()- Returns:
- whether the service marked the failure retryable
-
retryAfterMs
- Returns:
- for
rate_limited, the wait before a launch can succeed
-
field
-