-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved error when proj_create doesn't recognize definition #2529
Comments
One other thing to add is the
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Does anyone know where the relevant code is? I might have capacity to make this change |
Hi @frewsxcv, running your sample code I get:
Maybe this has been improved since you raised the issue? I think "proj_create: unrecognized format" is clear enough to point users in the right direction. Is there anything about it you'd want to change? |
Thanks for the update! |
The |
If proj_create() catches a ParsingException, set the error code to PROJ_ERR_INVALID_OP_WRONG_SYNTAX instead of the generic PROJ_ERR_OTHER. Ref OSGeo#2529
OK @frewsxcv, thanks, I think I understand the problem better now. I think this works better if we have proj_create set the error code to INVALID_OP_WRONG_SYNTAX ("Invalid PROJ string syntax") when the underlying function throws a ParsingException. Does that work for you? With this change, running your test program outputs as follows:
|
@direvus Yep, that's perfect. Thanks! |
If proj_create() catches a ParsingException, and the error code hasn't otherwise been set internally, set the error code to PROJ_ERR_INVALID_OP_WRONG_SYNTAX instead of allowing it to default to the generic PROJ_ERR_OTHER. Ref OSGeo#2529
If PROJ doesn't recognize the definition provided to
proj_create
, the error that gets returned isgeneric error of unknown origin
which makes it hard for users finding out what went wrongThe text was updated successfully, but these errors were encountered: