[gdal-dev] Towards more user-friendly error messages

Ari Jolma ari.jolma at tkk.fi
Wed Jun 17 10:25:04 EDT 2009


A colleague of mine is beginning to use GDAL via the Perl bindings (the
bindings are not the main issue however). He makes quite simple errors,
but is perplexed when he gets rather scary looking / uninformative error
messages. For example he forgot to open Shapefile with update turned on
(it is by default off at least in Perl bindings) and when he then calls
SetFeature the error is:

RuntimeError Error in psSHP->sHooks.FSeek() or fwrite() writing object
to .shp file.

Which for the initiated hints that maybe the file was opened read-only,
but for a newbie is just scary.

In this case there are two issues:

- the error is at layer method, although the data source was opened
read-only (does the layer know its data source and is it easy to query
from the data source, how it was opened - at least in the bindings
there's no method for that?)

- where to report the error nicely, for example "Can't call SetFeature
with a read-only layer, you moron."

Is this a policy issue, or is this a case-by-case issue? How could we
find and list the frequently made mistakes?

Regards,

Ari

-- 
Prof. Ari Jolma
Environmental Management Information Technology
Teknillinen Korkeakoulu / Helsinki University of Technology
tel: +358 9 4511 address: POBox 5300, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://geoinformatics.tkk.fi




More information about the gdal-dev mailing list