Martin Landa wrote:

> > Beyond that, we should probably think about how to deal with errors in
> > the Python scripting library. I.e. whether to raise Python exceptions,
> > return status codes, call fatal(), etc. Right now, each function does
> > as it pleases; there isn't any consistency.
> 
> r44086 helps a bit?
> 
> error() raise ScriptException() by default. If you call
> raise_on_error(False) then error() prints error message via `g.message
> -e`.

There's still the question of when to generate errors. E.g. should
run_command() just return the exit code or should it generate an error
if the exit code is non-zero? If it raises an exception, the actual
exit code should be retrievable from the exception object.

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to