alumbra.errors

explain

added in 0.1.0

(explain result input-string)

Like explain-str but prints to stdout.

explain-data

added in 0.1.0

(explain-data {:keys [alumbra/parser-errors alumbra/validation-errors]} input-string)

Given the result of a parser/validation operation, as well as the original input as a string, generate a seq of maps describing any occured errors:

  • :locations: the error locations,
  • :context: the part of the input-string affected,
  • :message: an error message,
  • :hint: an error hint for resolution, describing common causes.

explain-str

added in 0.1.0

(explain-str result input-string)

Given the result of a parser/validation operation, as well as the original input as a string, generate a description of any occured errors, including:

  • the original error message, including location(s),
  • the part of the code affected, as well as a few lines of context,
  • a hint on common causes for the given error.

format-data

added in 0.1.0

(format-data explained-errors)

Format the result of explain-data as a string.