View Source merlin_error (merlin v3.0.1)

Helpers for working with errors.

Summary

Functions

Callback for formatting error messages from this module

See also: erl_parse:format_error/1.

Callback for formatting error messages for merlin's modules.

Returns a error info with the given reason and location taken from the second argument. If it is a stacktrace, the latter is taken from the first frame. Otherwise it is assumed to be a syntax node and its location is used.

Functions

-spec format_error(term()) -> string().
Callback for formatting error messages from this module

See also: erl_parse:format_error/1.

-spec format_error(Reason, erlang:stacktrace()) -> ErrorInfo
                when
                    Reason :: term(), ErrorInfo :: #{pos_integer() | general | reason => string()}.

Callback for formatting error messages for merlin's modules.

See EEP 54
Link to this function

into_error_marker(Reason, Node)

View Source
-spec into_error_marker(Reason, Stacktrace | Node) -> merlin:error_marker()
                     when
                         Reason :: term(), Stacktrace :: erlang:stacktrace(), Node :: merlin:ast().
Returns a error info with the given reason and location taken from the second argument. If it is a stacktrace, the latter is taken from the first frame. Otherwise it is assumed to be a syntax node and its location is used.