Better error handling when init is present but wrong
This commit is contained in:
parent
95bf0d4b6c
commit
6d6fff2612
@ -117,9 +117,12 @@ join_errors(Prefix, Errors, Pfun) ->
|
|||||||
check_call(Source, "init" = FunName, Args, Options) ->
|
check_call(Source, "init" = FunName, Args, Options) ->
|
||||||
PatchFun = fun(T) -> {tuple, [typerep, T]} end,
|
PatchFun = fun(T) -> {tuple, [typerep, T]} end,
|
||||||
case check_call(Source, FunName, Args, Options, PatchFun) of
|
case check_call(Source, FunName, Args, Options, PatchFun) of
|
||||||
{error, _} when Args == [] ->
|
Err = {error, _} when Args == [] ->
|
||||||
%% Try with default init-function
|
%% Try with default init-function
|
||||||
check_call(insert_init_function(Source, Options), FunName, Args, Options, PatchFun);
|
case check_call(insert_init_function(Source, Options), FunName, Args, Options, PatchFun) of
|
||||||
|
{error, _} -> Err; %% The first error is most likely better...
|
||||||
|
Res -> Res
|
||||||
|
end;
|
||||||
Res ->
|
Res ->
|
||||||
Res
|
Res
|
||||||
end;
|
end;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user