diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-06-14 16:58:39 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-06-14 16:58:39 +0300 |
commit | 9e2e590061c41c1fa8d4ea5d8f4149162dc41c51 (patch) | |
tree | ef687a23a6457135c4524a5b2b766889ca3610a1 /src | |
parent | Fix validator of mod_avatar (diff) |
Fix exception formatting on old Erlang
Diffstat (limited to 'src')
-rw-r--r-- | src/misc.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/misc.erl b/src/misc.erl index 0ebcbef78..16e4122b5 100644 --- a/src/misc.erl +++ b/src/misc.erl @@ -482,6 +482,7 @@ peach(Fun, [_,_|_] = List) -> peach(Fun, List) -> lists:foreach(Fun, List). +-ifdef(HAVE_ERL_ERROR). format_exception(Level, Class, Reason, Stacktrace) -> erl_error:format_exception( Level, Class, Reason, Stacktrace, @@ -489,6 +490,15 @@ format_exception(Level, Class, Reason, Stacktrace) -> fun(Term, I) -> io_lib:print(Term, I, 80, -1) end). +-else. +format_exception(Level, Class, Reason, Stacktrace) -> + lib:format_exception( + Level, Class, Reason, Stacktrace, + fun(_M, _F, _A) -> false end, + fun(Term, I) -> + io_lib:print(Term, I, 80, -1) + end). +-endif. -spec parse_ip_mask(binary()) -> {ok, {inet:ip4_address(), 0..32}} | {ok, {inet:ip6_address(), 0..128}} | |