Opened 2 years ago
Last modified 11 months ago
#1001 assigned defect
Where possible, the GDAL provider should try to include the result of CPLGetLastErrorMsg() in its exception message before throwing
Reported by: | jng | Owned by: | jng |
---|---|---|---|
Priority: | major | Milestone: | 4.2.0 |
Component: | GDAL Provider | Version: | 4.1.0 |
Severity: | 3 | Keywords: | |
Cc: | External ID: |
Description
This particular post on mapguide-users has revealed some glaring quality issues in the error messages that the GDAL provider can throw back to the client FDO application:
https://lists.osgeo.org/pipermail/mapguide-users/2022-September/034673.html
In that particular case, the error message is "Fail to get image information" (msg id: GRFP_95_CANNOT_GET_IMAGE_INFO
). This is thrown if we fail to obtain a GDALDatasetH
handle from a GDALOpen
call.
In a case like this, we should be able to get more information from GDAL/OGR about why this is happening. GDAL/OGR provides a CPLGetLastErrorMsg
function that may provide extra information around why the GDALOpen
call couldn't give us a dataset handle. There are possibly other cases where such valuable information is not being included.
We should review the GDAL provider codebase for all cases where a FdoException
is being thrown and see if it is possible/appropriate to call CPLGetLastErrorMsg
and append that information into the exception message before throwing