Re: [GRASS-user] using try/except with grass.mapcalc in a Python Script

2011-03-11 Thread Glynn Clements
Jenny Turner wrote: > What I want to do is run grass.mapcalc like this: > try: >grass.mapcalc() > except: >grass.fatal(_("An error occurred ...")) grass.mapcalc() already calls grass.fatal() if r.mapcalc exits with a non-zero exit code (which will happen in the case of a syntax error or

Re: [GRASS-user] using try/except with grass.mapcalc in a Python Script

2011-03-11 Thread Jenny Turner
Hello Glynn What I want to do is run grass.mapcalc like this: try: grass.mapcalc() except: grass.fatal(_("An error occurred ...")) I know that this doesn't work. What I want to catch is not "syntax" erros but errors such as an raster input map that does not exist and is being used in grass.

Re: [GRASS-user] using try/except with grass.mapcalc in a Python Script

2011-03-01 Thread Glynn Clements
Jenny Turner wrote: > I want to include grass.mapcalc function in try except but I'm not catching > the errors. Has anyone used this for grass.mapcalc? What sort of error are you expecting? If you call set_raise_on_error(), a non-zero exit status should raise a ScriptException instead of callin

[GRASS-user] using try/except with grass.mapcalc in a Python Script

2011-03-01 Thread Jenny Turner
Greetings I want to include grass.mapcalc function in try except but I'm not catching the errors. Has anyone used this for grass.mapcalc? Thanks Jenny ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-u