The Mojo SDK reports failures in two places: on the RpcResponse for errors the server returns, and as raised Mojo Error values for transport and protocol failures.
Response errors
A query that the server rejects comes back as an RpcResponse with is_error() true. Read the code and message with error_code() and error_message().
Raised errors
Transport and protocol failures raise Mojo Error values whose messages carry a typed prefix from SurrealErrorKind:
The kinds live in surrealdb.errors.SurrealErrorKind and cover connection, protocol, RPC, query, auth, decode, engine, serialization, live-query, timeout, and unsupported-feature failures.
The matching helper functions (fail_connection, fail_protocol, fail_unsupported_feature, and the rest) are exported, so you can raise SDK-shaped errors from your own code.
Unsupported features
Before issuing a request that needs a stateful feature, the client checks the active transport's capabilities(). If the transport does not support the feature, the SDK raises an UnsupportedFeatureError rather than sending a request the server would reject. This is how an HTTP-only connection responds to a live query or a session request.