Postgrex.ErrorCode
SourceSummary↑
code_to_name(code) | Translates a Postgres error code into a name |
name_to_code(name) | Translates a Postgres error name into a list of possible codes. Most error names have only a single code, but there are exceptions |
Functions
Specs:
- code_to_name(String.t) :: atom | no_return
Translates a Postgres error code into a name
Examples:
iex> code_to_name("23505")
:unique_violation
Specs:
- name_to_code(atom) :: [String.t] | no_return
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"