[Gdal-dev] CPLErrorV change to better support scriptland
kruland at ku.edu
Sun Jun 19 21:36:13 EDT 2005
One of the things Shawn expressed dissatisfaction from was for some
problems, gdal will abort() and the interpreter would go away very
quickly. This of course, is not very nice behavour.
The problem is very apparent in the NG swig code because I don't do any
special parameter checking prior to calling the underlying method. So
for example, say "out.tif" only contains one layer, then if I do this:
f = gdal.Open( 'out.tif' )
The underlying GDALDataset::GetRasterBand() gets the numer 42 with no
prior checking. It rightfually decides this is a good time to issue a
CPLError( CE_Fatal,....). The problem is CPLErrorV will call abort() if
the error class is CE_Fatal. Bye bye python.
I see that in the old bindings, you place extra checks in the script
side for the parameters. This is not very amenable to supporting
Is there any way to remove this abort() entirely and leave it up to the
application to decide if a problem is serious enough to abort? It just
seems more polite but I don't understand what the implications would be.
More information about the Gdal-dev