The SDK provides a hierarchy of custom exceptions for robust error handling. Catch WSSError to handle any SDK-raised error, or catch specific subclasses when you need call- or buffer-level recovery.
CALL_UNANSWERED for connect()When you call connect(), the callee may not answer within the ring window. In that case the SDK raises WSSCallCommandError with error_code == "CALL_UNANSWERED" and the call remains active, so you can retry, try a different branch in your flow, or end the call.
WSSCallClosedError or buffer exceptions before WSSErrorBufferFullError where you are calling send_audio()BufferClosedError and WSSCallClosedError can happen when a caller hangs up mid-responseerror_code for command-specific recovery - CALL_UNANSWERED is the clearest example for connect() flowsclose() carefully because its behavior depends on call state: after connect() the agent leaves, but after answer() without connect() the caller is disconnected too. Use disconnect() when you explicitly want the whole call to end