sp_error (spectra v0.7.0)
View SourceSummary
Functions
-spec append_location(#sp_error{location :: [string() | atom()], type :: decode_error | type_mismatch | no_match | missing_data | not_matched_fields, ctx :: #{type => spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), value => dynamic(), errors => [{spectra:sp_type(), [#sp_error{}]}], message => string(), type_args => [{atom(), spectra:sp_type()}], err_type => atom(), err_reason => term()}}, string() | atom()) -> #sp_error{location :: [string() | atom()], type :: decode_error | type_mismatch | no_match | missing_data | not_matched_fields, ctx :: #{type => spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), value => dynamic(), errors => [{spectra:sp_type(), [#sp_error{}]}], message => string(), type_args => [{atom(), spectra:sp_type()}], err_type => atom(), err_reason => term()}}.
-spec missing_data(spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), dynamic(), [string() | atom()]) -> #sp_error{location :: [string() | atom()], type :: decode_error | type_mismatch | no_match | missing_data | not_matched_fields, ctx :: #{type => spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), value => dynamic(), errors => [{spectra:sp_type(), [#sp_error{}]}], message => string(), type_args => [{atom(), spectra:sp_type()}], err_type => atom(), err_reason => term()}}.
-spec no_match(spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), dynamic(), [{spectra:sp_type(), [#sp_error{location :: [string() | atom()], type :: decode_error | type_mismatch | no_match | missing_data | not_matched_fields, ctx :: #{type => spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), value => dynamic(), errors => [{spectra:sp_type(), [#sp_error{}]}], message => string(), type_args => [{atom(), spectra:sp_type()}], err_type => atom(), err_reason => term()}}]}]) -> #sp_error{location :: [string() | atom()], type :: decode_error | type_mismatch | no_match | missing_data | not_matched_fields, ctx :: #{type => spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), value => dynamic(), errors => [{spectra:sp_type(), [#sp_error{}]}], message => string(), type_args => [{atom(), spectra:sp_type()}], err_type => atom(), err_reason => term()}}.
-spec not_matched_fields(spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), dynamic()) -> #sp_error{location :: [string() | atom()], type :: decode_error | type_mismatch | no_match | missing_data | not_matched_fields, ctx :: #{type => spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), value => dynamic(), errors => [{spectra:sp_type(), [#sp_error{}]}], message => string(), type_args => [{atom(), spectra:sp_type()}], err_type => atom(), err_reason => term()}}.
-spec type_mismatch(spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), dynamic()) -> #sp_error{location :: [string() | atom()], type :: decode_error | type_mismatch | no_match | missing_data | not_matched_fields, ctx :: #{type => spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), value => dynamic(), errors => [{spectra:sp_type(), [#sp_error{}]}], message => string(), type_args => [{atom(), spectra:sp_type()}], err_type => atom(), err_reason => term()}}.
-spec type_mismatch(spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), dynamic(), map()) -> #sp_error{location :: [string() | atom()], type :: decode_error | type_mismatch | no_match | missing_data | not_matched_fields, ctx :: #{type => spectra:sp_type_or_ref() | spectra:map_field() | spectra:record_field(), value => dynamic(), errors => [{spectra:sp_type(), [#sp_error{}]}], message => string(), type_args => [{atom(), spectra:sp_type()}], err_type => atom(), err_reason => term()}}.