exceptionstableSource
@API(status = STABLE)
public class StopException
    extends RuntimeException

A controlled abort/stop signal with structured details. Throw this when an operation must be terminated intentionally (user cancel, precondition failed, safety stop) rather than due to an unexpected bug.

Superclasses
RuntimeException → Exception → Throwable
Implemented interfaces
Serializable

Methods

public static StopException fatal(String reason)
Parameters
reasonString
Returns
StopException
public String getCode()
Returns
String
public Map<String, String> getMetadata()
Returns
Map<String, String>
public String getReason()
Returns
String
public Severity getSeverity()
Returns
Severity
public long getTimestampEpochMillis()
Returns
long
public Instant getTimestampInstant()
Returns
Instant
public boolean isRecoverable()
Returns
boolean
public static StopException preconditionFailed(String reason)
Parameters
reasonString
Returns
StopException
public String toJson()
Returns
String
public String toUserFriendlyMessage()
Returns
String
public static StopException userCancel(String reason)
Parameters
reasonString
Returns
StopException

Nested types

Used by

Methods of other types that accept or return StopException.