[GRASS-dev] G_error in Vlib

Wolf Bergenheim wolf+grass at bergenheim.net
Tue Jun 6 07:05:44 EDT 2006


On Tue, 6 Jun 2006, Hamish wrote:

> 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. (;
>
>
> So what's wrong with "WARNING:" ?   what's the situation?
>

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).

> what about:  G_message("ERROR: zombies");
>

Doesn't do the ERROR or WARN magic (like email etc.), and it doesn't beep ;)

>
> If it must happen, perhaps it should be called G_nonfatal_error() or
> something more explicit than G_error()?
>

If you have G_error and G_fatal_error and both are documented, then it 
would be quite clear which does what? But if you like G_nonfatal_error 
better then I can live with it too. I don't really care that much about 
the function name, but I do care what it does (;

--W

-- 

<:3 )---- Wolf Bergenheim ----( 8:>




More information about the grass-dev mailing list