[GRASS-dev] G_error in Vlib

Hamish hamish_nospam at yahoo.com
Tue Jun 6 07:21:42 EDT 2006


Wolf:
> >>>> I need G_error (function that does the same thing as
> >>>> G_fatal_error except that it does not exit). Any objections to me
> >>>> adding it (as soon as I get my CVS working again)? I think it can
> >>>> be good to have a possibility of issuing an error message that
> >>>> doesn't call exit.
Glynn:
> >>> That's essentially what G_warning() does.
> >>>
Wolf:
> >> Yes but it puts a 'WARNING: '-prefix and not a 'ERROR: '-prefix. (;
>
Hamish:
> > So what's wrong with "WARNING:" ?   what's the situation?
>
Wolf:
> It is a fatal error but I can not use G_fatal_error because it calls
> exit, and I need to properly close the vector in v.edit. One such
> case is for instance that the DB connection fails. I still need to
> build the topology or else the vector file is broken (need to run
> v.build on it before you can continue).

so when you detect an error call a cleanup function to sort out the
mess, and have G_fatal_error() as the fn's last line?


Hamish




More information about the grass-dev mailing list