Postgrex v0.13.4 Postgrex.ErrorCode View Source
Link to this section Summary
Functions
Translates a Postgres error code into a name
Translates a Postgres error name into a list of possible codes. Most error names have only a single code, but there are exceptions
Link to this section Functions
Link to this function
code_to_name(code)
View Source
code_to_name(String.t()) :: atom() | no_return()
Translates a Postgres error code into a name
Examples:
iex> code_to_name("23505")
:unique_violation
Translates a Postgres error name into a list of possible codes. Most error names have only a single code, but there are exceptions.
Examples:
iex> name_to_code(:prohibited_sql_statement_attempted)
"2F003"