diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-01-17 00:24:03 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-01-17 00:52:19 +0100 |
| commit | 4724025e6c817761052fc0dc8810fd489a9e0104 (patch) | |
| tree | 21117e52f95b8f36880efef8cd71c1fcec21242c /src/grids.cpp | |
| parent | 66fd99a8831955034cb25c8468ecfe1f9d3a7d62 (diff) | |
| parent | d76e6202d27c730b4dcbf16b8c1575c11b703485 (diff) | |
| download | PROJ-4724025e6c817761052fc0dc8810fd489a9e0104.tar.gz PROJ-4724025e6c817761052fc0dc8810fd489a9e0104.zip | |
Merge branch 'master' into rfc4_merge_back_master
Diffstat (limited to 'src/grids.cpp')
| -rw-r--r-- | src/grids.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/grids.cpp b/src/grids.cpp index d5f961f7..24fcfe83 100644 --- a/src/grids.cpp +++ b/src/grids.cpp @@ -1345,7 +1345,6 @@ VerticalShiftGridSet::open(PJ_CONTEXT *ctx, const std::string &filename) { auto fp = FileManager::open_resource_file(ctx, filename.c_str()); if (!fp) { - ctx->last_errno = 0; /* don't treat as a persistent error */ return nullptr; } const auto actualName(fp->name()); @@ -2275,7 +2274,6 @@ HorizontalShiftGridSet::open(PJ_CONTEXT *ctx, const std::string &filename) { auto fp = FileManager::open_resource_file(ctx, filename.c_str()); if (!fp) { - ctx->last_errno = 0; /* don't treat as a persistent error */ return nullptr; } const auto actualName(fp->name()); @@ -2655,7 +2653,6 @@ GenericShiftGridSet::open(PJ_CONTEXT *ctx, const std::string &filename) { auto fp = FileManager::open_resource_file(ctx, filename.c_str()); if (!fp) { - ctx->last_errno = 0; /* don't treat as a persistent error */ return nullptr; } const auto actualName(fp->name()); @@ -2762,9 +2759,12 @@ ListOfGenericGrids pj_generic_grid_init(PJ *P, const char *gridkey) { auto gridSet = GenericShiftGridSet::open(P->ctx, gridname); if (!gridSet) { if (!canFail) { - pj_ctx_set_errno(P->ctx, PJD_ERR_FAILED_TO_LOAD_GRID); + if (proj_context_errno(P->ctx) != PJD_ERR_NETWORK_ERROR) { + pj_ctx_set_errno(P->ctx, PJD_ERR_FAILED_TO_LOAD_GRID); + } return {}; } + pj_ctx_set_errno(P->ctx, 0); // don't treat as a persistent error } else { grids.emplace_back(std::move(gridSet)); } @@ -2803,9 +2803,12 @@ static ListOfHGrids getListOfGridSets(PJ_CONTEXT *ctx, const char *grids) { auto gridSet = HorizontalShiftGridSet::open(ctx, gridname); if (!gridSet) { if (!canFail) { - pj_ctx_set_errno(ctx, PJD_ERR_FAILED_TO_LOAD_GRID); + if (proj_context_errno(ctx) != PJD_ERR_NETWORK_ERROR) { + pj_ctx_set_errno(ctx, PJD_ERR_FAILED_TO_LOAD_GRID); + } return {}; } + pj_ctx_set_errno(ctx, 0); // don't treat as a persistent error } else { list.emplace_back(std::move(gridSet)); } @@ -3228,9 +3231,12 @@ ListOfVGrids pj_vgrid_init(PJ *P, const char *gridkey) { auto gridSet = VerticalShiftGridSet::open(P->ctx, gridname); if (!gridSet) { if (!canFail) { - pj_ctx_set_errno(P->ctx, PJD_ERR_FAILED_TO_LOAD_GRID); + if (proj_context_errno(P->ctx) != PJD_ERR_NETWORK_ERROR) { + pj_ctx_set_errno(P->ctx, PJD_ERR_FAILED_TO_LOAD_GRID); + } return {}; } + pj_ctx_set_errno(P->ctx, 0); // don't treat as a persistent error } else { grids.emplace_back(std::move(gridSet)); } |
