Sort errors by position
This commit is contained in:
parent
9eeb9ab11d
commit
0f612ead90
@ -59,7 +59,8 @@ pos(File, Line, Col) ->
|
||||
-spec throw(_) -> ok | no_return().
|
||||
throw([]) -> ok;
|
||||
throw(Errs) when is_list(Errs) ->
|
||||
erlang:throw({error, Errs});
|
||||
SortedErrs = lists:sort(fun(E1, E2) -> E1#err.pos =< E2#err.pos end, Errs),
|
||||
erlang:throw({error, SortedErrs});
|
||||
throw(#err{} = Err) ->
|
||||
erlang:throw({error, [Err]}).
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user