Class BetaManagedAgentsSessionErrorEvent.Error
-
- All Implemented Interfaces:
public final class BetaManagedAgentsSessionErrorEvent.Error
-
-
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.
public final classBetaManagedAgentsSessionErrorEvent.Error.Type
-
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 Optional<BetaManagedAgentsToolUseLimitReachedError>toolUseLimitReached()The turn stopped because the agent loop reached its limit on tool-use rounds (one model response that calls tools, plus running those tools, is one round), not because a request failed. final Optional<BetaManagedAgentsCompactionLimitReachedError>compactionLimitReached()The turn stopped because the context was compacted the maximum number of times in a row without the model producing a message or a tool call, not because a request failed. final Optional<BetaManagedAgentsRepositoryAuthenticationError>repositoryAuthentication()The repository host rejected the credentials, or required credentials and received none. final Optional<BetaManagedAgentsRepositoryForbiddenError>repositoryForbidden()The repository host refused access to the repository. final Optional<BetaManagedAgentsRepositoryNotFoundError>repositoryNotFound()The repository host reported the repository as not found. final Optional<BetaManagedAgentsRepositoryCheckoutError>repositoryCheckout()The requested branch or commit does not exist in the repository. final Optional<BetaManagedAgentsRepositoryCloneError>repositoryClone()The repository could not be cloned. final Optional<JsonValue>_json()final BetaManagedAgentsSessionErrorEvent.Error.Typetype()final Stringmessage()final Optional<String>mcpServerName()final Optional<String>repositoryUrl()final BooleanisUnknown()final BooleanisModelOverloaded()final BooleanisModelRateLimited()final BooleanisModelRequestFailed()final BooleanisMcpConnectionFailed()final BooleanisMcpAuthenticationFailed()final BooleanisBilling()final BooleanisCredentialHostUnreachable()final BooleanisToolUseLimitReached()final BooleanisCompactionLimitReached()final BooleanisRepositoryAuthentication()final BooleanisRepositoryForbidden()final BooleanisRepositoryNotFound()final BooleanisRepositoryCheckout()final BooleanisRepositoryClone()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 BetaManagedAgentsToolUseLimitReachedErrorasToolUseLimitReached()The turn stopped because the agent loop reached its limit on tool-use rounds (one model response that calls tools, plus running those tools, is one round), not because a request failed. final BetaManagedAgentsCompactionLimitReachedErrorasCompactionLimitReached()The turn stopped because the context was compacted the maximum number of times in a row without the model producing a message or a tool call, not because a request failed. final BetaManagedAgentsRepositoryAuthenticationErrorasRepositoryAuthentication()The repository host rejected the credentials, or required credentials and received none. final BetaManagedAgentsRepositoryForbiddenErrorasRepositoryForbidden()The repository host refused access to the repository. final BetaManagedAgentsRepositoryNotFoundErrorasRepositoryNotFound()The repository host reported the repository as not found. final BetaManagedAgentsRepositoryCheckoutErrorasRepositoryCheckout()The requested branch or commit does not exist in the repository. final BetaManagedAgentsRepositoryCloneErrorasRepositoryClone()The repository could not be cloned. 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.final static BetaManagedAgentsSessionErrorEvent.ErrorofToolUseLimitReached(BetaManagedAgentsToolUseLimitReachedError toolUseLimitReached)The turn stopped because the agent loop reached its limit on tool-use rounds (one model response that calls tools, plus running those tools, is one round), not because a request failed. final static BetaManagedAgentsSessionErrorEvent.ErrorofCompactionLimitReached(BetaManagedAgentsCompactionLimitReachedError compactionLimitReached)The turn stopped because the context was compacted the maximum number of times in a row without the model producing a message or a tool call, not because a request failed. final static BetaManagedAgentsSessionErrorEvent.ErrorofRepositoryAuthentication(BetaManagedAgentsRepositoryAuthenticationError repositoryAuthentication)The repository host rejected the credentials, or required credentials and received none. final static BetaManagedAgentsSessionErrorEvent.ErrorofRepositoryForbidden(BetaManagedAgentsRepositoryForbiddenError repositoryForbidden)The repository host refused access to the repository. final static BetaManagedAgentsSessionErrorEvent.ErrorofRepositoryNotFound(BetaManagedAgentsRepositoryNotFoundError repositoryNotFound)The repository host reported the repository as not found. final static BetaManagedAgentsSessionErrorEvent.ErrorofRepositoryCheckout(BetaManagedAgentsRepositoryCheckoutError repositoryCheckout)The requested branch or commit does not exist in the repository. final static BetaManagedAgentsSessionErrorEvent.ErrorofRepositoryClone(BetaManagedAgentsRepositoryCloneError repositoryClone)The repository could not be cloned. -
-
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.
-
toolUseLimitReached
final Optional<BetaManagedAgentsToolUseLimitReachedError> toolUseLimitReached()
The turn stopped because the agent loop reached its limit on tool-use rounds (one model response that calls tools, plus running those tools, is one round), not because a request failed. The thread goes idle with
stop_reason: retries_exhausted(a child thread then terminates); the nextuser.messagestarts a new turn.
-
compactionLimitReached
final Optional<BetaManagedAgentsCompactionLimitReachedError> compactionLimitReached()
The turn stopped because the context was compacted the maximum number of times in a row without the model producing a message or a tool call, not because a request failed. The thread goes idle with
stop_reason: retries_exhausted(a child thread then terminates); the nextuser.messagestarts a new turn.
-
repositoryAuthentication
final Optional<BetaManagedAgentsRepositoryAuthenticationError> repositoryAuthentication()
The repository host rejected the credentials, or required credentials and received none.
-
repositoryForbidden
final Optional<BetaManagedAgentsRepositoryForbiddenError> repositoryForbidden()
The repository host refused access to the repository.
-
repositoryNotFound
final Optional<BetaManagedAgentsRepositoryNotFoundError> repositoryNotFound()
The repository host reported the repository as not found.
-
repositoryCheckout
final Optional<BetaManagedAgentsRepositoryCheckoutError> repositoryCheckout()
The requested branch or commit does not exist in the repository.
-
repositoryClone
final Optional<BetaManagedAgentsRepositoryCloneError> repositoryClone()
The repository could not be cloned.
-
type
final BetaManagedAgentsSessionErrorEvent.Error.Type type()
-
mcpServerName
final Optional<String> mcpServerName()
-
repositoryUrl
final Optional<String> repositoryUrl()
-
isModelOverloaded
final Boolean isModelOverloaded()
-
isModelRateLimited
final Boolean isModelRateLimited()
-
isModelRequestFailed
final Boolean isModelRequestFailed()
-
isMcpConnectionFailed
final Boolean isMcpConnectionFailed()
-
isMcpAuthenticationFailed
final Boolean isMcpAuthenticationFailed()
-
isCredentialHostUnreachable
final Boolean isCredentialHostUnreachable()
-
isToolUseLimitReached
final Boolean isToolUseLimitReached()
-
isCompactionLimitReached
final Boolean isCompactionLimitReached()
-
isRepositoryAuthentication
final Boolean isRepositoryAuthentication()
-
isRepositoryForbidden
final Boolean isRepositoryForbidden()
-
isRepositoryNotFound
final Boolean isRepositoryNotFound()
-
isRepositoryCheckout
final Boolean isRepositoryCheckout()
-
isRepositoryClone
final Boolean isRepositoryClone()
-
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.
-
asToolUseLimitReached
final BetaManagedAgentsToolUseLimitReachedError asToolUseLimitReached()
The turn stopped because the agent loop reached its limit on tool-use rounds (one model response that calls tools, plus running those tools, is one round), not because a request failed. The thread goes idle with
stop_reason: retries_exhausted(a child thread then terminates); the nextuser.messagestarts a new turn.
-
asCompactionLimitReached
final BetaManagedAgentsCompactionLimitReachedError asCompactionLimitReached()
The turn stopped because the context was compacted the maximum number of times in a row without the model producing a message or a tool call, not because a request failed. The thread goes idle with
stop_reason: retries_exhausted(a child thread then terminates); the nextuser.messagestarts a new turn.
-
asRepositoryAuthentication
final BetaManagedAgentsRepositoryAuthenticationError asRepositoryAuthentication()
The repository host rejected the credentials, or required credentials and received none.
-
asRepositoryForbidden
final BetaManagedAgentsRepositoryForbiddenError asRepositoryForbidden()
The repository host refused access to the repository.
-
asRepositoryNotFound
final BetaManagedAgentsRepositoryNotFoundError asRepositoryNotFound()
The repository host reported the repository as not found.
-
asRepositoryCheckout
final BetaManagedAgentsRepositoryCheckoutError asRepositoryCheckout()
The requested branch or commit does not exist in the repository.
-
asRepositoryClone
final BetaManagedAgentsRepositoryCloneError asRepositoryClone()
The repository could not be cloned.
-
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.
-
ofToolUseLimitReached
final static BetaManagedAgentsSessionErrorEvent.Error ofToolUseLimitReached(BetaManagedAgentsToolUseLimitReachedError toolUseLimitReached)
The turn stopped because the agent loop reached its limit on tool-use rounds (one model response that calls tools, plus running those tools, is one round), not because a request failed. The thread goes idle with
stop_reason: retries_exhausted(a child thread then terminates); the nextuser.messagestarts a new turn.
-
ofCompactionLimitReached
final static BetaManagedAgentsSessionErrorEvent.Error ofCompactionLimitReached(BetaManagedAgentsCompactionLimitReachedError compactionLimitReached)
The turn stopped because the context was compacted the maximum number of times in a row without the model producing a message or a tool call, not because a request failed. The thread goes idle with
stop_reason: retries_exhausted(a child thread then terminates); the nextuser.messagestarts a new turn.
-
ofRepositoryAuthentication
final static BetaManagedAgentsSessionErrorEvent.Error ofRepositoryAuthentication(BetaManagedAgentsRepositoryAuthenticationError repositoryAuthentication)
The repository host rejected the credentials, or required credentials and received none.
-
ofRepositoryForbidden
final static BetaManagedAgentsSessionErrorEvent.Error ofRepositoryForbidden(BetaManagedAgentsRepositoryForbiddenError repositoryForbidden)
The repository host refused access to the repository.
-
ofRepositoryNotFound
final static BetaManagedAgentsSessionErrorEvent.Error ofRepositoryNotFound(BetaManagedAgentsRepositoryNotFoundError repositoryNotFound)
The repository host reported the repository as not found.
-
ofRepositoryCheckout
final static BetaManagedAgentsSessionErrorEvent.Error ofRepositoryCheckout(BetaManagedAgentsRepositoryCheckoutError repositoryCheckout)
The requested branch or commit does not exist in the repository.
-
ofRepositoryClone
final static BetaManagedAgentsSessionErrorEvent.Error ofRepositoryClone(BetaManagedAgentsRepositoryCloneError repositoryClone)
The repository could not be cloned.
-
-
-
-