Permalink
Browse files

Merge pull request #5 from shizzard/master

z_apply custom errors
  • Loading branch information...
2 parents e27f29e + 2ec5ae2 commit 292c85e4433dc92f22590359ce11120d79145acd @si14 committed Nov 14, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/z_validate.erl
View
@@ -83,6 +83,7 @@ z_apply(Fun, ?Z_VALUE(_, Err)=ZVal) ->
z_apply(Fun, ?Z_VALUE(Val, _Err), NewErr) ->
case catch Fun(Val) of
{ok, NewVal} -> ?Z_VALUE(NewVal, NewErr);
+ {error, Err} -> ?THROW_Z_ERROR(Err);
_ -> ?THROW_Z_ERROR(NewErr)
end.

0 comments on commit 292c85e

Please sign in to comment.