Class BetaManagedAgentsSessionErrorEvent.Error
-
- All Implemented Interfaces:
public final class BetaManagedAgentsSessionErrorEvent.ErrorAn unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsSessionErrorEvent.Error.VisitorAn interface that defines how to map each variant of Error to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsUnknownError>unknown()An unknown or unexpected error occurred during session execution. final Optional<BetaManagedAgentsModelOverloadedError>modelOverloaded()The model is currently overloaded. final Optional<BetaManagedAgentsModelRateLimitedError>modelRateLimited()The model request was rate-limited. final Optional<BetaManagedAgentsModelRequestFailedError>modelRequestFailed()A model request failed for a reason other than overload or rate-limiting. final Optional<BetaManagedAgentsMcpConnectionFailedError>mcpConnectionFailed()Failed to connect to an MCP server. final Optional<BetaManagedAgentsMcpAuthenticationFailedError>mcpAuthenticationFailed()Authentication to an MCP server failed. final Optional<BetaManagedAgentsBillingError>billing()The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. final Optional<BetaManagedAgentsCredentialHostUnreachableError>credentialHostUnreachable()An environment_variablecredential'sauth.networking.allowed_hostsincludes a host the environment's network policy does not permit.final BooleanisUnknown()final BooleanisModelOverloaded()final BooleanisModelRateLimited()final BooleanisModelRequestFailed()final BooleanisMcpConnectionFailed()final BooleanisMcpAuthenticationFailed()final BooleanisBilling()final BooleanisCredentialHostUnreachable()final BetaManagedAgentsUnknownErrorasUnknown()An unknown or unexpected error occurred during session execution. final BetaManagedAgentsModelOverloadedErrorasModelOverloaded()The model is currently overloaded. final BetaManagedAgentsModelRateLimitedErrorasModelRateLimited()The model request was rate-limited. final BetaManagedAgentsModelRequestFailedErrorasModelRequestFailed()A model request failed for a reason other than overload or rate-limiting. final BetaManagedAgentsMcpConnectionFailedErrorasMcpConnectionFailed()Failed to connect to an MCP server. final BetaManagedAgentsMcpAuthenticationFailedErrorasMcpAuthenticationFailed()Authentication to an MCP server failed. final BetaManagedAgentsBillingErrorasBilling()The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. final BetaManagedAgentsCredentialHostUnreachableErrorasCredentialHostUnreachable()An environment_variablecredential'sauth.networking.allowed_hostsincludes a host the environment's network policy does not permit.final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsSessionErrorEvent.Error.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsSessionErrorEvent.Errorvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsSessionErrorEvent.ErrorofUnknown(BetaManagedAgentsUnknownError unknown)An unknown or unexpected error occurred during session execution. final static BetaManagedAgentsSessionErrorEvent.ErrorofModelOverloaded(BetaManagedAgentsModelOverloadedError modelOverloaded)The model is currently overloaded. final static BetaManagedAgentsSessionErrorEvent.ErrorofModelRateLimited(BetaManagedAgentsModelRateLimitedError modelRateLimited)The model request was rate-limited. final static BetaManagedAgentsSessionErrorEvent.ErrorofModelRequestFailed(BetaManagedAgentsModelRequestFailedError modelRequestFailed)A model request failed for a reason other than overload or rate-limiting. final static BetaManagedAgentsSessionErrorEvent.ErrorofMcpConnectionFailed(BetaManagedAgentsMcpConnectionFailedError mcpConnectionFailed)Failed to connect to an MCP server. final static BetaManagedAgentsSessionErrorEvent.ErrorofMcpAuthenticationFailed(BetaManagedAgentsMcpAuthenticationFailedError mcpAuthenticationFailed)Authentication to an MCP server failed. final static BetaManagedAgentsSessionErrorEvent.ErrorofBilling(BetaManagedAgentsBillingError billing)The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. final static BetaManagedAgentsSessionErrorEvent.ErrorofCredentialHostUnreachable(BetaManagedAgentsCredentialHostUnreachableError credentialHostUnreachable)An environment_variablecredential'sauth.networking.allowed_hostsincludes a host the environment's network policy does not permit.-
-
Method Detail
-
unknown
final Optional<BetaManagedAgentsUnknownError> unknown()
An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.
-
modelOverloaded
final Optional<BetaManagedAgentsModelOverloadedError> modelOverloaded()
The model is currently overloaded. Emitted after automatic retries are exhausted.
-
modelRateLimited
final Optional<BetaManagedAgentsModelRateLimitedError> modelRateLimited()
The model request was rate-limited.
-
modelRequestFailed
final Optional<BetaManagedAgentsModelRequestFailedError> modelRequestFailed()
A model request failed for a reason other than overload or rate-limiting.
-
mcpConnectionFailed
final Optional<BetaManagedAgentsMcpConnectionFailedError> mcpConnectionFailed()
Failed to connect to an MCP server.
-
mcpAuthenticationFailed
final Optional<BetaManagedAgentsMcpAuthenticationFailedError> mcpAuthenticationFailed()
Authentication to an MCP server failed.
-
billing
final Optional<BetaManagedAgentsBillingError> billing()
The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
-
credentialHostUnreachable
final Optional<BetaManagedAgentsCredentialHostUnreachableError> credentialHostUnreachable()
An
environment_variablecredential'sauth.networking.allowed_hostsincludes a host the environment's network policy does not permit.
-
isModelOverloaded
final Boolean isModelOverloaded()
-
isModelRateLimited
final Boolean isModelRateLimited()
-
isModelRequestFailed
final Boolean isModelRequestFailed()
-
isMcpConnectionFailed
final Boolean isMcpConnectionFailed()
-
isMcpAuthenticationFailed
final Boolean isMcpAuthenticationFailed()
-
isCredentialHostUnreachable
final Boolean isCredentialHostUnreachable()
-
asUnknown
final BetaManagedAgentsUnknownError asUnknown()
An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.
-
asModelOverloaded
final BetaManagedAgentsModelOverloadedError asModelOverloaded()
The model is currently overloaded. Emitted after automatic retries are exhausted.
-
asModelRateLimited
final BetaManagedAgentsModelRateLimitedError asModelRateLimited()
The model request was rate-limited.
-
asModelRequestFailed
final BetaManagedAgentsModelRequestFailedError asModelRequestFailed()
A model request failed for a reason other than overload or rate-limiting.
-
asMcpConnectionFailed
final BetaManagedAgentsMcpConnectionFailedError asMcpConnectionFailed()
Failed to connect to an MCP server.
-
asMcpAuthenticationFailed
final BetaManagedAgentsMcpAuthenticationFailedError asMcpAuthenticationFailed()
Authentication to an MCP server failed.
-
asBilling
final BetaManagedAgentsBillingError asBilling()
The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
-
asCredentialHostUnreachable
final BetaManagedAgentsCredentialHostUnreachableError asCredentialHostUnreachable()
An
environment_variablecredential'sauth.networking.allowed_hostsincludes a host the environment's network policy does not permit.
-
accept
final <T extends Any> T accept(BetaManagedAgentsSessionErrorEvent.Error.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = error.accept(new Error.Visitor<Optional<String>>() { @Override public Optional<String> visitUnknown(BetaManagedAgentsUnknownError unknown) { return Optional.of(unknown.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsSessionErrorEvent.Error validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofUnknown
final static BetaManagedAgentsSessionErrorEvent.Error ofUnknown(BetaManagedAgentsUnknownError unknown)
An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on
retry_statusandmessagealone.
-
ofModelOverloaded
final static BetaManagedAgentsSessionErrorEvent.Error ofModelOverloaded(BetaManagedAgentsModelOverloadedError modelOverloaded)
The model is currently overloaded. Emitted after automatic retries are exhausted.
-
ofModelRateLimited
final static BetaManagedAgentsSessionErrorEvent.Error ofModelRateLimited(BetaManagedAgentsModelRateLimitedError modelRateLimited)
The model request was rate-limited.
-
ofModelRequestFailed
final static BetaManagedAgentsSessionErrorEvent.Error ofModelRequestFailed(BetaManagedAgentsModelRequestFailedError modelRequestFailed)
A model request failed for a reason other than overload or rate-limiting.
-
ofMcpConnectionFailed
final static BetaManagedAgentsSessionErrorEvent.Error ofMcpConnectionFailed(BetaManagedAgentsMcpConnectionFailedError mcpConnectionFailed)
Failed to connect to an MCP server.
-
ofMcpAuthenticationFailed
final static BetaManagedAgentsSessionErrorEvent.Error ofMcpAuthenticationFailed(BetaManagedAgentsMcpAuthenticationFailedError mcpAuthenticationFailed)
Authentication to an MCP server failed.
-
ofBilling
final static BetaManagedAgentsSessionErrorEvent.Error ofBilling(BetaManagedAgentsBillingError billing)
The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.
-
ofCredentialHostUnreachable
final static BetaManagedAgentsSessionErrorEvent.Error ofCredentialHostUnreachable(BetaManagedAgentsCredentialHostUnreachableError credentialHostUnreachable)
An
environment_variablecredential'sauth.networking.allowed_hostsincludes a host the environment's network policy does not permit.
-
-
-
-