mirror of
https://github.com/valitydev/parse_trans.git
synced 2024-11-06 00:25:16 +00:00
slightly better error messages for codegen:gen_module/3
This commit is contained in:
parent
072a7ef0ab
commit
86d94e3248
@ -196,10 +196,17 @@ xform_fun(_, Form, _Ctxt, Acc) ->
|
||||
{Form, Acc}.
|
||||
|
||||
gen_module(NameF, ExportsF, FunsF, L, Acc) ->
|
||||
try gen_module_(NameF, ExportsF, FunsF, L, Acc)
|
||||
catch
|
||||
error:E ->
|
||||
ErrStr = parse_trans:format_exception(error, E),
|
||||
case erl_syntax:type(FunsF) of
|
||||
list ->
|
||||
try gen_module_(NameF, ExportsF, FunsF, L, Acc)
|
||||
catch
|
||||
error:E ->
|
||||
ErrStr = parse_trans:format_exception(error, E),
|
||||
{error, {L, ?MODULE, ErrStr}}
|
||||
end;
|
||||
_ ->
|
||||
ErrStr = parse_trans:format_exception(
|
||||
error, "Argument must be a list"),
|
||||
{error, {L, ?MODULE, ErrStr}}
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user