[Gdal-dev] CPLErrorV change to better support scriptland

Frank Warmerdam fwarmerdam at gmail.com
Mon Jun 20 10:27:24 EDT 2005


On 6/20/05, Kevin Ruland <kruland at ku.edu> wrote:
> Frank.
> 
> That would certainly be true and it would be up to the programmer to
> make sure they didn't do anything stupid, like ignore the exception.  In
> the event of such an error, the script might have some important work to
> do such as return an error page (in cgi applications) or close databases
> or start a pot of coffee for a late night debugging session and the
> premature abort() would prevent any action.

Kevin,

Right.  However, in my experience, with the GetRasterBand() case
set aside, abort() fatal errors are very rare.  It only really happens
if CPLMalloc() fails and that only normally happens if a size calculation
goes wonky.  Large allocations are normally done via VSIMalloc()
(a direct wrapper) and in those cases the caller is expected to recover
gracefully from a failed allocation.
 
> Actually, if the error was from malloc, there could be quite a bit of
> invalidation throughout the interpreter.  Maybe this wouldn't be such a
> good idea.

Well, safe recover might still be difficult.  My suggestion is not to 
worry about this aspect much at this time as I don't think it will arise
except in the worst of circumstances in the future. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list