[Gdal-dev] SWIG Exceptions for C# Bindings

Simon Perkins sy at perkins.net
Thu Mar 15 23:28:12 EDT 2007


Can someone remind me how error reporting works with the GDAL and OGR C# 
bindings? Do errors typically throw exceptions, or return status codes, 
or nulls, or both? There seems to be code to throw exceptions in most of 
the method definitions, but the code in swig/csharp/apps often appears 
to be checking for return null values instead. Which is correct?

For instance, if OGR.DataSource.GetLayerByIndex() is invoked with an 
invalid index, or if something else goes wrong, do we always/sometimes 
get an exception or do we just get a null back? Is there a general policy?

Cheers,

Simon




More information about the Gdal-dev mailing list