Error Handling

View Source

DuckdbEx maps DuckDB error strings into structured exceptions. Most functions return {:error, exception} tuples.

case DuckdbEx.execute("SELECT * FROM missing_table") do
  {:ok, _} -> :ok
  {:error, exception} -> IO.inspect(exception)
end

Common exception types:

When using the CLI backend, error messages are emitted on stderr and converted to the closest matching exception type.