[gdal-dev] Catch a GDALOpen exception

canduc17 candini at meeo.it
Wed Apr 6 12:04:10 EDT 2011


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 GDALOpen if the file is not
existent and manage it in a way to return an integer that I want and not the
default 134.

How can I achieve this?

Thanks in advance!

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Catch-a-GDALOpen-exception-tp6246599p6246599.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list