[erlang-questions] is empty catch statement possible?

Motiejus Jakštys desired.mta@REDACTED
Thu Feb 9 19:39:28 CET 2012


Whoops, a small mistake in code. Fixed version:

-define(silent(Level, Expr), (fun() ->
                 __Lager_OldLevel = lager:get_loglevel(lager_console_backend),
+                lager:set_loglevel(lager_console_backend, Level),
                 try 
                     fun() -> Expr end 
                 catch
                     throw:'$__should_never_be_thrown' -> ok
                 after
                     leger:set_loglevel(lager_console_backend, __Lager_OldLevel)
                 end 
         end)()).

Motiejus



More information about the erlang-questions mailing list