Comprehensive error handling for ScyllaDB-specific errors.
This module provides structured error types for ScyllaDB/Cassandra errors, user-friendly error messages, and suggestions for resolving common issues.
Error Categories
- Connection Errors: Issues connecting to ScyllaDB nodes
- Query Errors: Invalid CQL syntax, type mismatches
- Consistency Errors: Write/read consistency failures
- Schema Errors: Table, keyspace, or column not found
- Rate Limiting: Overloaded nodes, timeout errors
- Configuration Errors: Invalid configuration options
Usage
case repo.query(query, params) do
{:ok, result} ->
{:ok, result}
{:error, %Xandra.Error{} = error} ->
{:error, AshScylla.Error.ScyllaError.from_xandra_error(error)}
{:error, %Xandra.ConnectionError{} = error} ->
{:error, AshScylla.Error.ScyllaError.from_xandra_connection_error(error)}
end
Summary
Functions
Creates a ScyllaError from a generic error.
Creates a ScyllaError from a Xandra.ConnectionError.
Creates a ScyllaError from a Xandra.ConnectionError with query context.
Creates a ScyllaError from a Xandra.Error.
Creates a ScyllaError from a Xandra.Error with query context.
Converts the error to a human-readable string.
Creates a ScyllaError with query context.
Types
Functions
Creates a ScyllaError from a generic error.
@spec from_xandra_connection_error(Xandra.ConnectionError.t()) :: t()
Creates a ScyllaError from a Xandra.ConnectionError.
@spec from_xandra_connection_error(Xandra.ConnectionError.t(), String.t() | nil) :: t()
Creates a ScyllaError from a Xandra.ConnectionError with query context.
@spec from_xandra_error(Xandra.Error.t()) :: t()
Creates a ScyllaError from a Xandra.Error.
@spec from_xandra_error(Xandra.Error.t(), String.t() | nil) :: t()
Creates a ScyllaError from a Xandra.Error with query context.
Converts the error to a human-readable string.
Creates a ScyllaError with query context.
Convenience function for wrapping an error that includes the query that caused it.