aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/c_api.cpp
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2019-04-02 22:45:27 +0200
committerGitHub <noreply@github.com>2019-04-02 22:45:27 +0200
commitc0d91bd3c0870233e1d0a207cef4de8f65885f6d (patch)
treeb0ea23e51b883e99bf62c362c34a7bab8e5b48a7 /src/iso19111/c_api.cpp
parent41fe4d06282f5a5374cd6d19382e0e37c2c277bc (diff)
parent20300c1fd5b35bf1d577a3726f02940d02c73f54 (diff)
downloadPROJ-c0d91bd3c0870233e1d0a207cef4de8f65885f6d.tar.gz
PROJ-c0d91bd3c0870233e1d0a207cef4de8f65885f6d.zip
Merge pull request #1405 from kbevers/return_errno_proj_create
Make sure that ISO19111 C++ code sets pj_errno on errors
Diffstat (limited to 'src/iso19111/c_api.cpp')
-rw-r--r--src/iso19111/c_api.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp
index b15b8e34..970d38d8 100644
--- a/src/iso19111/c_api.cpp
+++ b/src/iso19111/c_api.cpp
@@ -77,6 +77,11 @@ static void PROJ_NO_INLINE proj_log_error(PJ_CONTEXT *ctx, const char *function,
msg += ": ";
msg += text;
ctx->logger(ctx->logger_app_data, PJ_LOG_ERROR, msg.c_str());
+ auto previous_errno = pj_ctx_get_errno(ctx);
+ if (previous_errno == 0) {
+ // only set errno if it wasn't set deeper down the call stack
+ pj_ctx_set_errno(ctx, PJD_ERR_GENERIC_ERROR);
+ }
}
// ---------------------------------------------------------------------------