SpdxExpression.Error exception (SpdxExpression v0.1.0)

Copy Markdown View Source

Structured validation error returned by SpdxExpression.

Offsets are zero-based byte offsets into the original input.

Summary

Types

Stable category for an SPDX expression validation failure.

t()

A structured validation failure with its original token and byte offset.

Types

kind()

@type kind() ::
  :invalid_type
  | :empty_expression
  | :invalid_character
  | :unexpected_token
  | :unexpected_end
  | :unbalanced_parenthesis
  | :unknown_license
  | :unknown_exception
  | :deprecated_license
  | :deprecated_exception
  | :invalid_license_ref
  | :invalid_plus_suffix
  | :invalid_with_operand
  | :expression_too_long
  | :expression_too_deep

Stable category for an SPDX expression validation failure.

t()

@type t() :: %SpdxExpression.Error{
  __exception__: true,
  kind: kind(),
  message: String.t(),
  offset: non_neg_integer() | nil,
  suggestion: String.t() | nil,
  token: binary() | nil
}

A structured validation failure with its original token and byte offset.