CFG.RecognizerError exception (cfg_lib v0.1.0) View Source

Link to this section Summary

Types

t()

This type represents an error which occurred when processing CFG.

Link to this section Types

Specs

t() :: %CFG.RecognizerError{
  __exception__: term(),
  detail: nil | any(),
  location: nil | %CFG.Location{column: term(), line: term()},
  reason: atom()
}

This type represents an error which occurred when processing CFG.

These are its fields:

  • location: The optional location of the error in the source. Some errors may have no location.
  • reason: An atom indicating the kind of error.
  • detail: Optional additional information about the error.

Here are the error reasons currently in use:

  • invalid_escape - an invalid escape sequence was detected in a string.
  • unterminated_backtick - a backtick-string is unterminated.
  • newlines_not_allowed - newlines aren't allowed in strings other than multi-line strings.
  • unterminated_string - a quoted string is unterminated.
  • bad_number - a number is badly formed.
  • bad_octal_constant - a number which looks like an octal constant is badly formed.
  • unexpected_char - an unexpected character was encountered.
  • unexpected_token - an unexpected token was encountered.
  • unexpected_token_for_value - an unexpected token was encountered when looking for a value.
  • unexpected_token_for_atom - an unexpected token was encountered when looking for an atomic value.
  • bad_key_value_separator - a bad key/value separator was encountered.
  • unexpected_for_key - an unexpected token was encountered when looking for a key in a mapping.
  • unexpected_token_for_container - an unexpected token was encountered when parsing a container.
  • text_after_container - there is trailing text following text for a valid container.
  • invalid_index - an array or slice index is invalid.
  • unexpected_token_for_expression - an unexpected token was encountered when looking for an expression.
  • must_be_mapping - a top-level configuration must be a mapping.
  • invalid_path - a CFG path is invalid.
  • invalid_path_extra - there is text following what looks like a valid CFG path.
  • no_configuration - no configuration has been loaded.
  • not_found - the specified key or path was not found in this configuration.
  • invalid_step - an invalid step (zero) was specified.
  • unexpected_path_start - a CFG path doesn't begin as expected (with an identifier).
  • cannot_evaluate - an expression cannot be evaluated.
  • string_expected - a string was expected, but not found.
  • include_not_found - an included configuration was not found.
  • cannot_add - an addition cannot be performed.
  • cannot_negate - a negation cannot be performed.
  • cannot_subtract - a subtraction cannot be performed.
  • cannot_multiply - a multiplication cannot be performed.
  • cannot_divide - a division cannot be performed.
  • cannot_integer_divide - an integer division cannot be performed.
  • cannot_compute_modulo - a modulo operation cannot be performed.
  • cannot_left_shift - a left shift cannot be performed.
  • cannot_right_shift - a right shift cannot be performed.
  • cannot_raise_to_power - raise to power operation cannot be performed.
  • cannot_bitwise_or - a bitwise-or operation cannot be performed.
  • cannot_bitwise_and - a bitwise-and operation cannot be performed.
  • cannot_bitwise_xor - a bitwise-xor operation cannot be performed.
  • unknown_variable - a variable is undefined or no context was provided.
  • conversion_failure - a string conversion operation cannot be performed.
  • circular_reference - a circular reference was detected when resolving references.
  • not_implemented - a feature is not implemented.