ExArrow. FlightSQL. Error exception
(ex_arrow v0.6.0)
View Source
Structured error type for Flight SQL operations.
All client and transport failures are returned as {:error, %ExArrow.FlightSQL.Error{}} from
non-bang functions, or raised from bang functions (e.g. query!/2).
Error codes
| Code | Source |
|---|---|
:transport_error | TCP/TLS channel failure before any RPC completes |
:server_error | gRPC INTERNAL status from the server |
:unimplemented | gRPC UNIMPLEMENTED — server does not support the operation |
:unauthenticated | gRPC UNAUTHENTICATED — missing or rejected credentials |
:permission_denied | gRPC PERMISSION_DENIED |
:not_found | gRPC NOT_FOUND |
:invalid_argument | gRPC INVALID_ARGUMENT — bad SQL syntax, wrong parameter types |
:protocol_error | Malformed or unexpected Flight SQL response structure |
:multi_endpoint | FlightInfo returned more than one endpoint; not supported in v0.5.0 |
:invalid_option | Invalid connect or query option at the Elixir layer |
:conversion_error | Arrow → Explorer or Arrow → Nx conversion failure |
Examples
{:error, %ExArrow.FlightSQL.Error{code: :invalid_argument, message: "syntax error"}} =
ExArrow.FlightSQL.Client.query(client, "SELECT FROM")
try do
ExArrow.FlightSQL.Client.query!(client, "BAD SQL")
rescue
e in ExArrow.FlightSQL.Error -> IO.inspect(e.code)
end
Summary
Types
@type code() ::
:transport_error
| :server_error
| :unimplemented
| :unauthenticated
| :permission_denied
| :not_found
| :invalid_argument
| :protocol_error
| :multi_endpoint
| :invalid_option
| :conversion_error