From 244a24104ded3a4573aeffa32160af21f76cbce6 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 15 Dec 2020 00:51:46 +0100 Subject: Revise error codes to have a reduced set exposed in the public API. Fixes #2482 And also add proj_context_errno_string() Revise gie 'expect failure errno XXXX' strings --- src/projections/isea.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/projections/isea.cpp') diff --git a/src/projections/isea.cpp b/src/projections/isea.cpp index 77a5689b..7a782f3d 100644 --- a/src/projections/isea.cpp +++ b/src/projections/isea.cpp @@ -1026,7 +1026,7 @@ static PJ_XY isea_s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward try { out = isea_forward(&Q->dgg, &in); } catch( const char* ) { - proj_errno_set(P, PJD_ERR_NON_CONVERGENT); + proj_errno_set(P, PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN); return proj_coord_error().xy; } @@ -1041,7 +1041,7 @@ PJ *PROJECTION(isea) { char *opt; struct pj_opaque *Q = static_cast(calloc (1, sizeof (struct pj_opaque))); if (nullptr==Q) - return pj_default_destructor (P, ENOMEM); + return pj_default_destructor (P, PROJ_ERR_INVALID_OP /*ENOMEM*/); P->opaque = Q; @@ -1059,7 +1059,8 @@ PJ *PROJECTION(isea) { } else if (!strcmp(opt, "pole")) { isea_orient_pole(&Q->dgg); } else { - return pj_default_destructor(P, PJD_ERR_ELLIPSOID_USE_REQUIRED); + proj_log_error(P, _("Invalid value for orient: only isea or pole are supported")); + return pj_default_destructor(P, PROJ_ERR_INVALID_OP_ILLEGAL_ARG_VALUE); } } @@ -1089,8 +1090,8 @@ PJ *PROJECTION(isea) { Q->dgg.output = ISEA_HEX; } else { - /* TODO verify error code. Possibly eliminate magic */ - return pj_default_destructor(P, PJD_ERR_ELLIPSOID_USE_REQUIRED); + proj_log_error(P, _("Invalid value for mode: only plane, di, dd or hex are supported")); + return pj_default_destructor(P, PROJ_ERR_INVALID_OP_ILLEGAL_ARG_VALUE); } } -- cgit v1.2.3