> Even,
>
> Yes, you are right. I missed you mean the CPLError. In case of custom
> throwing handler it will jump out of the context. I do throw exceptions
> reacting on GDAL errors, but not from within GDAL internal context,
> like the custom handler.
Yes, of course you are free to emit C++ exce
Even Rouault wrote:
> Mateusz Loskot wrote:
>> This is interesting. Could you give example?
>> How is checking if GDALOpen returned NULL and prematurely exiting
>> different to throwing exception?
>
> The ::Open() method of GDAL drivers is supposed to make all necessary
> cleanups, even in case of
> This is interesting. Could you give example?
> How is checking if GDALOpen returned NULL and prematurely exiting
> different to throwing exception?
Mateusz,
The ::Open() method of GDAL drivers is supposed to make all necessary
cleanups, even in case of errors, before returning NULL.
But if yo
Even Rouault wrote:
> Le mercredi 06 avril 2011 18:09:42, Howard Butler a écrit :
>> You need to implement your own error handler if you want GDAL to throw
>> exceptions when it can open something.
>
> I would recommand *against* doing that. Throwing exceptions from the GDAL
> error handler can lea
Le mercredi 06 avril 2011 18:09:42, Howard Butler a écrit :
> On Apr 6, 2011, at 11:04 AM, canduc17 wrote:
> > I have this incorrect code:
> > try
> >
> > {
> > myDataset = (GDALDataset *) GDALOpen( "myimg", GA_ReadOnly );
> > }
> > catch(int n)
> > {
> >
> > c
On Apr 6, 2011, at 11:04 AM, canduc17 wrote:
> I have this incorrect code:
> try
> {
> myDataset = (GDALDataset *) GDALOpen( "myimg", GA_ReadOnly );
> }
> catch(int n)
> {
> cout << "File not existent!" << endl;
>return 14;
> }
>
I have this incorrect code:
try
{
myDataset = (GDALDataset *) GDALOpen( "myimg", GA_ReadOnly );
}
catch(int n)
{
cout << "File not existent!" << endl;
return 14;
}
I would like to catch the exception thrown by GDALOpe