[erlang-questions] style question - best way to test multiple non-guard conditions sequentially
Mon Jun 24 14:51:47 CEST 2013
Hello Jonathan, hello list.
In _some_ cases to avoid such validation nesting I use try/catch and
v1 = proplists:get_value(p1, L),
v2 = proplists:get_value(p2, L),
v3 = proplists:get_value(p3, L)
%% handle exception here and return
%% or re-throw it
But you should clearly understand what code you will wrap with try/catch.
It is possible hide some errors inside this block,
so i try not not wrap complex logic inside, only some input validators.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions