Skip to content

Commit

Permalink
Use combined CPLErrorStateBackuper + CPLQuietErrorHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Apr 6, 2024
1 parent be71b41 commit cd6e64e
Show file tree
Hide file tree
Showing 31 changed files with 60 additions and 109 deletions.
13 changes: 5 additions & 8 deletions apps/gdalinfo_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ char *GDALInfo(GDALDatasetH hDataset, const GDALInfoOptions *psOptions)
}
{
// PROJJSON requires PROJ >= 6.2
CPLErrorHandlerPusher oPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oCPLErrorHandlerPusher;
CPLErrorStateBackuper oCPLErrorHandlerPusher(
CPLQuietErrorHandler);
char *pszProjJson = nullptr;
OGRErr result =
OSRExportToPROJJSON(hSRS, &pszProjJson, nullptr);
Expand Down Expand Up @@ -721,8 +721,7 @@ char *GDALInfo(GDALDatasetH hDataset, const GDALInfoOptions *psOptions)
{
// Check that it looks like Earth before trying to reproject to wgs84...
// OSRGetSemiMajor() may raise an error on CRS like Engineering CRS
CPLErrorHandlerPusher oPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oCPLErrorHandlerPusher;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
OGRErr eErr = OGRERR_NONE;
if (fabs(OSRGetSemiMajor(hProj, &eErr) - 6378137.0) < 10000.0 &&
eErr == OGRERR_NONE)
Expand Down Expand Up @@ -759,8 +758,7 @@ char *GDALInfo(GDALDatasetH hDataset, const GDALInfoOptions *psOptions)
/* -------------------------------------------------------------------- */
if (bJson && GDALGetRasterXSize(hDataset))
{
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);

json_object *poLinearRing = json_object_new_array();
json_object *poCornerCoordinates = json_object_new_object();
Expand Down Expand Up @@ -803,8 +801,7 @@ char *GDALInfo(GDALDatasetH hDataset, const GDALInfoOptions *psOptions)
}
else if (GDALGetRasterXSize(hDataset))
{
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);

Concat(osStr, psOptions->bStdoutOutput, "Corner Coordinates:\n");
GDALInfoReportCorner(psOptions, hDataset, hTransform, "Upper Left", 0.0,
Expand Down
9 changes: 3 additions & 6 deletions apps/gdalmdimtranslate_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,7 @@ static bool TranslateArray(

std::shared_ptr<GDALDimension> dstDim;
{
CPLErrorHandlerPusher oHandlerPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
if (!srcDimFullName.empty() && srcDimFullName[0] == '/')
{
dstDim =
Expand Down Expand Up @@ -1083,8 +1082,7 @@ static bool TranslateArray(
}
}

CPLErrorHandlerPusher oHandlerPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
auto poDstIndexingVar(poDstGroup->OpenMDArray(newDimName));
if (poDstIndexingVar)
dstDim->SetIndexingVariable(std::move(poDstIndexingVar));
Expand Down Expand Up @@ -1319,8 +1317,7 @@ static bool CopyGroup(
mapSrcToDstDims.find(oIterDimName->second);
if (oCorrespondingDimIter != mapSrcToDstDims.end())
{
CPLErrorHandlerPusher oHandlerPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
oCorrespondingDimIter->second->SetIndexingVariable(
std::move(dstArray));
}
Expand Down
6 changes: 2 additions & 4 deletions apps/gdalwarp_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ static CPLString GetSrcDSProjection(GDALDatasetH hDS, CSLConstList papszTO)
{
char *pszWKT = nullptr;
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
if (OSRExportToWkt(hSRS, &pszWKT) != OGRERR_NONE)
{
CPLFree(pszWKT);
Expand Down Expand Up @@ -4195,8 +4194,7 @@ static GDALDatasetH GDALWarpCreateOutput(
{
OGRSpatialReference oSrcSRS;
OGRSpatialReference oDstSRS;
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
// DemoteTo2D requires PROJ >= 6.3
if (oSrcSRS.SetFromUserInput(osThisSourceSRS.c_str()) ==
OGRERR_NONE &&
Expand Down
4 changes: 2 additions & 2 deletions apps/ogrinfo_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,8 +957,8 @@ static void ReportOnLayer(CPLString &osRet, CPLJSONObject &oLayer,
{
char *pszProjJson = nullptr;
// PROJJSON requires PROJ >= 6.2
CPLErrorHandlerPusher oPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oCPLErrorHandlerPusher;
CPLErrorStateBackuper oCPLErrorHandlerPusher(
CPLQuietErrorHandler);
CPL_IGNORE_RET_VAL(
poSRS->exportToPROJJSON(&pszProjJson, nullptr));
if (pszProjJson)
Expand Down
3 changes: 1 addition & 2 deletions frmts/gtiff/gtiffdataset_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3506,8 +3506,7 @@ static bool IsSRSCompatibleOfGeoTIFF(const OGRSpatialReference *poSRS,
}
OGRErr eErr;
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
if (poSRS->IsDerivedGeographic() ||
(poSRS->IsProjected() && !poSRS->IsCompound() &&
poSRS->GetAxesCount() == 3))
Expand Down
6 changes: 2 additions & 4 deletions frmts/nitf/nitfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1627,8 +1627,7 @@ NITFDataset *NITFDataset::OpenInternal(GDALOpenInfo *poOpenInfo,
VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG) == 0 &&
VSI_ISREG(sStatBuf.st_mode))
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
CPLXMLNode *psTree = CPLParseXMLFile(pszPAMFilename);
if (psTree)
{
Expand Down Expand Up @@ -1660,8 +1659,7 @@ NITFDataset *NITFDataset::OpenInternal(GDALOpenInfo *poOpenInfo,
VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG) == 0 &&
VSI_ISREG(sStatBuf.st_mode))
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
CPLXMLNode *psTree = CPLParseXMLFile(pszPAMFilename);
if (psTree)
{
Expand Down
3 changes: 1 addition & 2 deletions frmts/ogcapi/gdalogcapidataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1633,8 +1633,7 @@ ParseXMLSchema(const std::string &osURL,
std::vector<std::unique_ptr<OGRFieldDefn>> &apoFields,
OGRwkbGeometryType &eGeomType)
{
CPLErrorHandlerPusher oErrorHandlerPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);

std::vector<GMLFeatureClass *> apoClasses;
bool bFullyUnderstood = false;
Expand Down
3 changes: 1 addition & 2 deletions frmts/rmf/rmfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,8 +1197,7 @@ CPLErr RMFDataset::FlushCache(bool bAtClosing)
{
// ComputeRasterMinMax can setup error in case of dataset full
// from NoData values, but it makes no sense here.
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
poBand->ComputeRasterMinMax(FALSE, sHeader.adfElevMinMax);
bHeaderDirty = true;
}
Expand Down
6 changes: 2 additions & 4 deletions frmts/vrt/vrtsourcedrasterband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,7 @@ CPLErr VRTSourcedRasterBand::ComputeRasterMinMax(int bApproxOK,
CPLErr eErr;
std::string osLastErrorMsg;
{
CPLErrorHandlerPusher oPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
CPLErrorReset();
eErr =
ComputeStatistics(bApproxOK, &adfMinMax[0], &adfMinMax[1],
Expand Down Expand Up @@ -1404,8 +1403,7 @@ CPLErr VRTSourcedRasterBand::ComputeStatistics(int bApproxOK, double *pdfMin,
static_cast<uint64_t>(poSimpleSourceBand->GetXSize()) *
poSimpleSourceBand->GetYSize();

CPLErrorHandlerPusher oPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
CPLErr eErr = poSimpleSourceBand->ComputeStatistics(
psContext->bApproxOK, &psJob->dfMin, &psJob->dfMax,
&psJob->dfMean, &psJob->dfStdDev,
Expand Down
3 changes: 1 addition & 2 deletions frmts/zarr/zarr_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ CPLJSONObject ZarrArray::SerializeSpecialAttributes()
CPLFree(pszWKT);

{
CPLErrorHandlerPusher quietError(CPLQuietErrorHandler);
CPLErrorStateBackuper errorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
char *projjson = nullptr;
if (m_poSRS->exportToPROJJSON(&projjson, nullptr) == OGRERR_NONE &&
projjson != nullptr)
Expand Down
3 changes: 1 addition & 2 deletions frmts/zarr/zarr_v2_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1346,8 +1346,7 @@ ZarrV2Group::LoadArray(const std::string &osArrayName,
CPLJSONDocument oDoc;
const std::string osZattrsFilename(CPLFormFilename(
CPLGetDirname(osZarrayFilename.c_str()), ".zattrs", nullptr));
CPLErrorHandlerPusher quietError(CPLQuietErrorHandler);
CPLErrorStateBackuper errorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
if (oDoc.Load(osZattrsFilename))
{
oAttributes = oDoc.GetRoot();
Expand Down
3 changes: 1 addition & 2 deletions frmts/zarr/zarr_v2_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ void ZarrV2Group::LoadAttributes() const
CPLJSONDocument oDoc;
const std::string osZattrsFilename(
CPLFormFilename(m_osDirectoryName.c_str(), ".zattrs", nullptr));
CPLErrorHandlerPusher quietError(CPLQuietErrorHandler);
CPLErrorStateBackuper errorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
if (!oDoc.Load(osZattrsFilename))
return;
auto oRoot = oDoc.GetRoot();
Expand Down
6 changes: 2 additions & 4 deletions gcore/gdaldriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,8 +1574,7 @@ CPLErr GDALDriver::QuietDelete(const char *pszName,
}
else
{
CPLErrorStateBackuper oBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
poDriver = GDALDriver::FromHandle(GDALIdentifyDriver(pszName, nullptr));
}

Expand All @@ -1589,8 +1588,7 @@ CPLErr GDALDriver::QuietDelete(const char *pszName,
poDriver->pfnDeleteDataSource == nullptr;
if (bQuiet)
{
CPLErrorStateBackuper oBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
return poDriver->Delete(pszName);
}
else
Expand Down
3 changes: 1 addition & 2 deletions gcore/gdaljp2abstractdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,7 @@ char **GDALJP2AbstractDataset::GetMetadata(const char *pszDomain)
m_aosImageStructureMetadata.Assign(
CSLDuplicate(GDALGeorefPamDataset::GetMetadata(pszDomain)),
true);
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
const char *pszReversibility =
GDALGetJPEG2000Reversibility(GetDescription(), fp);
if (pszReversibility)
Expand Down
3 changes: 1 addition & 2 deletions gcore/gdaljp2metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,8 +1270,7 @@ bool GDALJP2Metadata::IsSRSCompatible(const OGRSpatialReference *poSRS)
return true;
}

CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
char *pszGMLDef = nullptr;
const bool bRet = (poSRS->exportToXML(&pszGMLDef, nullptr) == OGRERR_NONE);
CPLFree(pszGMLDef);
Expand Down
10 changes: 4 additions & 6 deletions gcore/gdalmultidim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,8 +1130,8 @@ bool GDALGroup::CopyFrom(const std::shared_ptr<GDALGroup> &poDstRootGroup,
mapExistingDstDims.find(oIterDimName->second);
if (oCorrespondingDimIter != mapExistingDstDims.end())
{
CPLErrorHandlerPusher oHandlerPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(
CPLQuietErrorHandler);
oCorrespondingDimIter->second->SetIndexingVariable(
std::move(dstArray));
}
Expand Down Expand Up @@ -13516,8 +13516,7 @@ void GDALPamMultiDim::Load()
pszProxyPam ? std::string(pszProxyPam) : d->m_osFilename + ".aux.xml";
CPLXMLTreeCloser oTree(nullptr);
{
CPLErrorStateBackuper oStateBackuper;
CPLErrorHandlerPusher oErrorHandlerPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
oTree.reset(CPLParseXMLFile(d->m_osPamFilename.c_str()));
}
if (!oTree)
Expand Down Expand Up @@ -13638,8 +13637,7 @@ void GDALPamMultiDim::Save()
{
char *pszWKT = nullptr;
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
const char *const apszOptions[] = {"FORMAT=WKT2", nullptr};
kv.second.poSRS->exportToWkt(&pszWKT, apszOptions);
}
Expand Down
12 changes: 4 additions & 8 deletions gcore/gdalpamdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ CPLXMLNode *GDALPamDataset::SerializeToXML(const char *pszUnused)
{
char *pszWKT = nullptr;
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
if (psPam->poSRS->exportToWkt(&pszWKT) != OGRERR_NONE)
{
CPLFree(pszWKT);
Expand Down Expand Up @@ -905,17 +904,15 @@ CPLErr GDALPamDataset::TryLoadXML(char **papszSiblingFiles)
papszSiblingFiles, CPLGetFilename(psPam->pszPamFilename));
if (iSibling >= 0)
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
psTree = CPLParseXMLFile(psPam->pszPamFilename);
}
}
else if (VSIStatExL(psPam->pszPamFilename, &sStatBuf,
VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG) == 0 &&
VSI_ISREG(sStatBuf.st_mode))
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
psTree = CPLParseXMLFile(psPam->pszPamFilename);
}

Expand Down Expand Up @@ -1042,8 +1039,7 @@ CPLErr GDALPamDataset::TrySaveXML()
VSI_STAT_EXISTS_FLAG | VSI_STAT_NATURE_FLAG) == 0 &&
VSI_ISREG(sStatBuf.st_mode))
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
psOldTree = CPLParseXMLFile(psPam->pszPamFilename);
}

Expand Down
12 changes: 4 additions & 8 deletions ogr/ogrct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ void OGRCoordinateTransformationOptions::Private::RefreshCheckWithInvertProj()

static char *GetWktOrProjString(const OGRSpatialReference *poSRS)
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
const char *const apszOptionsWKT2_2018[] = {"FORMAT=WKT2_2018", nullptr};
// If there's a PROJ4 EXTENSION node in WKT1, then use
// it. For example when dealing with "+proj=longlat +lon_wrap=180"
Expand Down Expand Up @@ -1536,8 +1535,7 @@ int OGRProjCT::Initialize(const OGRSpatialReference *poSourceIn,

const char *pszCENTER_LONG;
{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
pszCENTER_LONG =
poSRSSource ? poSRSSource->GetExtension("GEOGCS", "CENTER_LONG")
: nullptr;
Expand All @@ -1556,8 +1554,7 @@ int OGRProjCT::Initialize(const OGRSpatialReference *poSourceIn,
}

{
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
pszCENTER_LONG =
poSRSTarget ? poSRSTarget->GetExtension("GEOGCS", "CENTER_LONG")
: nullptr;
Expand Down Expand Up @@ -3358,8 +3355,7 @@ int OGRProjCT::TransformBounds(const double xmin, const double ymin,

if (poSRSTarget->IsProjected())
{
CPLErrorHandlerPusher oErrorHandlerPusher(CPLQuietErrorHandler);
CPLErrorStateBackuper oBackuper;
CPLErrorStateBackuper oBackuper(CPLQuietErrorHandler);

auto poBaseTarget = std::unique_ptr<OGRSpatialReference>(
poSRSTarget->CloneGeogCS());
Expand Down
3 changes: 1 addition & 2 deletions ogr/ogrsf_frmts/flatgeobuf/ogrflatgeobuflayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ OGRFlatGeobufLayer::OGRFlatGeobufLayer(const Header *poHeader, GByte *headerBuf,
if (const auto metadata = poHeader->metadata())
{
CPLJSONDocument oDoc;
CPLErrorHandlerPusher oQuietError(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);
if (oDoc.LoadMemory(metadata->c_str()) &&
oDoc.GetRoot().GetType() == CPLJSONObject::Type::Object)
{
Expand Down
3 changes: 1 addition & 2 deletions ogr/ogrsf_frmts/generic/ogrlayerarrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7436,8 +7436,7 @@ bool OGRLayer::WriteArrowBatch(const struct ArrowSchema *schema,

bool bTransactionOK;
{
CPLErrorHandlerPusher oHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oBackuper;
CPLErrorStateBackuper oBackuper(CPLQuietErrorHandler);
bTransactionOK = StartTransaction() == OGRERR_NONE;
}

Expand Down
6 changes: 2 additions & 4 deletions ogr/ogrsf_frmts/gmlas/ogrgmlasxsdcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ bool GMLASXSDCache::CacheAllGML321()
// Download the later and unzip it for faster fetching of GML schemas.

bool bSuccess = false;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);

const char *pszHTTPZIP = "https://schemas.opengis.net/gml/gml-3_2_2.zip";
CPLHTTPResult *psResult = CPLHTTPFetch(pszHTTPZIP, nullptr);
Expand Down Expand Up @@ -248,8 +247,7 @@ bool GMLASXSDCache::CacheAllISO20070417()
// Download the later and unzip it for faster fetching of ISO schemas.

bool bSuccess = false;
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oErrorStateBackuper;
CPLErrorStateBackuper oErrorStateBackuper(CPLQuietErrorHandler);

const char *pszHTTPZIP =
"https://schemas.opengis.net/iso/19139/iso19139-20070417.zip";
Expand Down
Loading

0 comments on commit cd6e64e

Please sign in to comment.