Re: About gsettings aborting on unkown schemas
- From: Emmanuele Bassi <ebassi gmail com>
- To: gtk-devel-list gnome org
- Subject: Re: About gsettings aborting on unkown schemas
- Date: Fri, 27 May 2011 17:02:18 +0100
On 2011-05-27 at 10:57, Shaun McCance wrote:
> On Fri, 2011-05-27 at 15:34 +0100, Emmanuele Bassi wrote:
> > On 2011-05-27 at 14:59, ecyrbe wrote:
> > > > and then what? abort the application? gracefully terminate with a
> > > > warning on the console?
> > > >
> > >
> > >
> > > No, you can gracefully show a popup to the user that something is broken and
> > > to the right direction. It's better than crashing.
> >
> > and what would a popup solve from the user's perspective? a missing
> > schema is a missing file, which means an installation problem. there is
> > *no* graceful way to handle that.
>
> If the application itself is missing files it needs (schemas,
> ui files, .la files, whatever), then yeah. If it's some plugin
> that's busted
how do you propose to define the difference between a plugin running in
the application space and an application? from a library perspective,
and from an application perspective, application + plugin and
application are exactly the same thing.
> this is how I'd write my application code in a
> language with real exception handling:
>
> try:
> load_some_extension()
> except:
> warn("This extension sucks. I'm disabling it and moving on.")
load_some_extension() *should* check if a schema exists in the current
path, and raise an exception if not found. Ryan is working on being able
to define custom search paths as well.
but once you reached g_settings_new() then there's nothing you can do
because anything after that assumes that the GSettings returned exist
and maps to a valid settings backend, with valid values.
> Of course, GLib is C. We don't have exceptions. We have GError,
> which is a decent foundation for exceptions in language bindings.
> But if we don't use it, then languages that could otherwise do
> the right thing are screwed.
GError is for recoverable run-time errors, not for installation errors; a
missing schema is an installation error.
by the way, GError, as it is implemented and used currently, is *not* an
exception-like system. I'm not against creating a GException, but that's
another thing, and the two should not be confused.
we don't have g_malloc(size_t, GError**) for OOM cases as well, I just
hope you're not honestly asking for that.
ciao,
Emmanuele.
--
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]