[Gdal-dev] Exception class(es) in SWIG C# wrapper

Richard Matsunaga richard.matsunaga at waypointinfo.com
Mon Mar 5 14:42:07 EST 2007


Would it be appropriate or possible to insert a GDAL-specific exception
class into the SWIG wrapper?
 
This exception would fetch the extended error information from GDAL and
automatically include this information in the exception message.
 
I did this in the old hand-rolled GDAL/OGR wrapper. Other than the many
constructors, it only needs to override the Message property.
 
 
/// <summary>
/// Gets the exception message. Includes the GDAL extended error message if
available.
/// </summary>
public override string Message
{
    get
    {
        return base.Message + "\n" + gdal.GetLastErrorMsg();
    }
}
 
 
Richard
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070305/089b6778/attachment.html


More information about the Gdal-dev mailing list