Classify Send Error • AI Agent SDK
classify_send_error: Pure, dependency-free fallback classifier for a send exception.
classify_send_error
Function
</div>
This function is defined in the base module.
Pure, dependency-free fallback classifier for a send exception.
Maps an exception into a :class:SendResult carrying a :class:SendErrorKind and derived `retryable flag, keying primarily off the HTTP/platform status code (highest fidelity) and falling back to a small set of generic, cross-platform substrings. It is deliberately conservative: anything it cannot confidently classify becomes UNKNOWN` (retryable), preserving the historical retry-everything default.
Adapters that know their native exception types should override :meth:BasePlatformAdapter.classify_error for higher fidelity; this ensures adapters that don’t still behave correctly for standard HTTP cases.
Signature
def classify_send_error(exc: BaseException) -> 'SendResult'Parameters
BaseExceptionNo description available.
Returns
'SendResult'The result of the operation.
Uses
SendResult
Used By
Source
View on GitHubpraisonaiagents/bots/base.py at line 240