Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion is empty catch statement possible?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lukas Larsson  
View profile  
 More options Feb 9 2012, 1:46 pm
From: Lukas Larsson <lu...@erlang-solutions.com>
Date: Thu, 9 Feb 2012 19:46:07 +0100
Local: Thurs, Feb 9 2012 1:46 pm
Subject: Re: [erlang-questions] is empty catch statement possible?
iirc you should be able to do:

try
   something
after
  io:format("hello after",[])
end.

Not sure how lager works, but if it keeps an external state for the
logging level it will not be reset if the process executing the try
catch is killed due to an exit msg.

Lukas

2012/2/9 Motiejus Jakštys <desired....@gmail.com>:

> 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
> _______________________________________________
> erlang-questions mailing list
> erlang-questi...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.