[GRASS-dev] GRASS scripting Python API error/fatal handling

Glynn Clements glynn at gclements.plus.com
Sun Sep 30 15:33:34 PDT 2012


Sören Gebbert wrote:

> > For simple clean-up operations, atexit.register() is sufficient.
> 
> While implementing this, can we use the "raise_on_error" flag to
> enable the raise of a ScriptError exception in fatal()?
> It would be only a simple modification of the current code i guess.

Yes. The only thing which needs to be done is to move the conditional
from error() to fatal(), and check any code which might be using
set_raise_on_error() in case it relies upon the existing behaviour.

Most scripts should continue to use atexit.register() for clean-up and
not bother with exception handling.

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


More information about the grass-dev mailing list