Re: [RFC] Gnome2::GConf error handling



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]