dot-notes v1.0.0 DotNotes.ParseException exception

Exception module for any issues which arise when parsing through notation.

Exposes a couple of functions to make raising easier by providing binary templates.

Summary

Functions

Callback implementation for c:Exception.exception/1

Formats a notation key, current character, and character index into an error message

Callback implementation for c:Exception.message/1

Raises a DotNotes.ParseException with a custom message

Raises a DotNotes.ParseException based on the provided args. These args are passed to format/3 in order to create a message for the Exception

Functions

exception(msg)

Specs

exception(String.t) :: Exception.t
exception(Keyword.t) :: Exception.t

Callback implementation for c:Exception.exception/1.

format(key, current, index)

Specs

format(key :: binary, current :: binary, index :: number) :: message :: binary

Formats a notation key, current character, and character index into an error message.

message(exception)

Specs

message(Exception.t) :: String.t

Callback implementation for c:Exception.message/1.

raise(msg)

Specs

raise(msg :: binary) :: DotNotes.ParseException

Raises a DotNotes.ParseException with a custom message.

This is used simply for convenience.

raise(key, current, index)

Specs

raise(key :: binary, current :: binary, index :: number) :: DotNotes.ParseException

Raises a DotNotes.ParseException based on the provided args. These args are passed to format/3 in order to create a message for the Exception.