[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [RFC] Gnome2::GConf error handling
- From: "Ross McFarland" <rwmcfa1 neces com>
- To: gtk-perl-list gnome org
- Subject: Re: [RFC] Gnome2::GConf error handling
- Date: Wed, 24 Sep 2003 11:21:55 -0400 (EDT)
Emmanuele Bassi said:
> * Situation in the Perl binding
> ...
> using croak(); it is completely transparent from the Perl programmer's
> ...
you may already know and be doing this, but you want to use gperl_croak_error
rather than the perlapi croak. mainly for memory allocation reasons.
> * Possible improvements
> ...
> So, I'd like to hear every comment you might have, and your alternative
> solutions, if any, about this.
>
(in my opinion) the perlish way of doing this would be:
my $client = Gnome2::GConf::Client->get_default;
my $str;
eval { $str = $client->get_string("/test/app/key"); 1 };
if( $@ )
{
# handle the error, ignore it, die etc.
}
if an error happens while in an eval you can catch and handle it. if it
happens without the eval context the app will just die. (with obvious
exceptions with Gtk2 callbacks)
-rm
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]