Squirrelix.Error (Squirrelix v0.4.0)

Copy Markdown View Source

Formatting and normalization helpers for Squirrelix errors.

Connection failures and timeouts during --infer are classified with connection_error/2 into CannotConnectToPostgres or PostgresConnectionTimeout, then formatted like other structured diagnostics.

Summary

Functions

Classifies a Postgrex / DBConnection connection failure into a structured error.

Functions

attach_query(error, query)

@spec attach_query(
  struct(),
  Squirrelix.Query.t()
) :: struct()

connection_error(reason, opts)

Classifies a Postgrex / DBConnection connection failure into a structured error.

format(error)

@spec format(struct()) :: String.t()

format_all(errors)

@spec format_all([struct()]) :: String.t()

normalize(error)

@spec normalize(struct()) :: struct()

postgresql_code(arg1)

@spec postgresql_code(struct()) :: String.t() | nil