An error reported by Mojibake.
Functions that can fail return {:error, %Mojibake.Error{}}; their ! variants raise it.
reason is one of:
:malformed_input- the input is not well-formed UTF-8 and the:malformedoption is:stop.offsetandlengthgive the byte range of the first ill-formed subsequence anddetailsays what is wrong with it, for example:missing_continuation.:invalid_locale- a BCP 47 language tag, such as the:localeoption, is not well-formed.:invalid_domain-Mojibake.IDNAfound the domain name invalid.detailis the list ofMojibake.IDNA.error/0.:no_memory- the C library could not allocate memory.:overflow- a size computation overflowed.- any other
mjb_statusof the C library, as an atom::invalid_argument,:invalid_encoding,:invalid_codepoint,:invalid_form,:unsupported,:output_too_small,:callback_stopped,:not_found,:feature_not_enabled, or:end_of_input.
Summary
Types
@type reason() :: atom()
@type t() :: %Mojibake.Error{ __exception__: term(), detail: atom() | [atom()] | nil, length: non_neg_integer() | nil, offset: non_neg_integer() | nil, reason: reason() }