A protocol error, as defined by the security error table of the Manual de Segurança do SFN (§5.5.1).
Fields:
:c03- the error code that goes in field C03 of the header (0x01..0x14, or0xFF).:egen- the matching GEN0004 error code ("EGEN9901".."EGEN9920"), ornilfor0xFF.:field- the header field the error refers to (:c01..:c15,:body), ornil.:message- a short description, in English.:reason- the internal cause, for logs only. It may say more than:c03does (see thec14_errors: :uniformoption ofSinetex.open/2), so do not send it to the counterparty.
The struct is an exception, so it can be raised, but Sinetex functions
always return it in an {:error, error} tuple.
Summary
Functions
Returns true if code is a valid, non-zero C03 error code.
All valid C03 error codes, in ascending order.
Builds the error for code, keeping reason for logs.
Types
@type code() :: 1..20 | 255
A C03 error code: 0x01..0x14 or 0xFF.
@type field() ::
:c01
| :c02
| :c04
| :c06
| :c07
| :c08
| :c09
| :c10
| :c11
| :c12
| :c13
| :c14
| :c15
| :body
| nil
Functions
Returns true if code is a valid, non-zero C03 error code.
@spec codes() :: [code(), ...]
All valid C03 error codes, in ascending order.
Builds the error for code, keeping reason for logs.
iex> error = Sinetex.Error.new(0x0B)
iex> {error.egen, error.field, error.message}
{"EGEN9911", :c15, "invalid signature"}