[GRASS-dev] set_fatal_error

Glynn Clements glynn at gclements.plus.com
Mon Jan 14 15:48:04 EST 2008


Martin Landa wrote:

> in Vlib/error.c are defined fns Vect_get_fatal_error(),
> Vect_set_fatal_error() which are currently used only in Vlib/open.c.
> 
> 00049 static void
> 00050 fatal_error ( int ferror, char *errmsg )
> 00051 {
> 00052       switch ( ferror ) {
> 00053           case GV_FATAL_EXIT:
> 00054               G_fatal_error ( errmsg );
> 00055               break;
> 00056           case GV_FATAL_PRINT:
> 00057               G_warning ( errmsg );
> 00058               break;
> 00059           case GV_FATAL_RETURN:
> 00060               break;
> 00061       }
> 00062 }
> 
> Maybe it would be good to move them to gislib, to enable programmer
> change behaviour of G_fatal_error() when really need, e.g. to avoid
> crashing GUI (qgis or native wxpython-based).

We already have G_set_error_routine(). However, a fundamental property
of G_fatal_error() is that it doesn't return (that's why the "fatal"
is part of the name).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list