[GRASS-dev] How to get stop a script with an error in a function

António Rocha antonio.rocha at deimos.com.pt
Fri Oct 15 05:47:05 EDT 2010


Hi there

I have built a Py Script that is similar to r.in.aster, I mean, to 
reproject/project a file and then import into grass.

The problem is when I select a non raster file. A get an error in 
GDALWARP but the script continue.
And then it calls r.in.gdal to import and then I get ERROR 4. What I 
want is a way to "stop" the process (with grass_fatal) when I get ERROR 4.
Is this possible? can anyone give me a tip? Some approach to get the 
error. I have tried with try: except: but it didn't work out

Thanks



__________ Information from ESET NOD32 Antivirus, version of virus signature database 5533 (20101015) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




More information about the grass-dev mailing list