Skip to content

Commit

Permalink
Merge pull request #10951 from rouault/safe_open_error
Browse files Browse the repository at this point in the history
Safe (Sentinel1): report failure to opening a band dataset as a warning
  • Loading branch information
rouault authored Oct 8, 2024
2 parents 7912e57 + d35cf96 commit c83a64b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion frmts/safe/safedataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1299,8 +1299,11 @@ GDALDataset *SAFEDataset::Open(GDALOpenInfo *poOpenInfo)
/* Try and open the file. */
/* --------------------------------------------------------------------
*/
CPLTurnFailureIntoWarning(true);
auto poBandFile = std::unique_ptr<GDALDataset>(
GDALDataset::Open(osFullFilename.c_str()));
GDALDataset::Open(osFullFilename.c_str(),
GDAL_OF_RASTER | GDAL_OF_VERBOSE_ERROR));
CPLTurnFailureIntoWarning(false);
if (poBandFile == nullptr)
{
// NOP
Expand Down
2 changes: 1 addition & 1 deletion port/cpl_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void CPL_DLL CPL_STDCALL CPLDefaultErrorHandler(CPLErr, CPLErrorNum,
const char *);
void CPL_DLL CPL_STDCALL CPLQuietErrorHandler(CPLErr, CPLErrorNum,
const char *);
void CPLTurnFailureIntoWarning(int bOn);
void CPL_DLL CPLTurnFailureIntoWarning(int bOn);

CPLErrorHandler CPL_DLL CPLGetErrorHandler(void **ppUserData);

Expand Down

0 comments on commit c83a64b

Please sign in to comment.