-
Notifications
You must be signed in to change notification settings - Fork 46
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
Handle null pointer when attempting to build an error string #74
base: main
Are you sure you want to change the base?
Conversation
The primary place that's affected by #73 is: Lines 133 to 139 in 81b233a
Specifically, the So the question I'm wondering: do we have a guarantee that PROJ will always generate non-zero error codes?
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a regression test for this? Could be as simple as:
#[test]
fn error_message_zero_code() {
assert!(error_message(0).is_err());
}
I don't want my previous message to block this as I think your pull request as-is is an improvement! Just wanted to get that thought out, as I'm not sure what the answer is. We can discuss it in a separate GitHub Issue if that's preferred
OK, I'll ask the authors to clarify the error code issue, and then let's see where we are. |
Awesome, thanks for doing that. Depending on the answer, I think there are some improvements I/we/they could make to the upstream PROJ documentation to clarify as it's currently ambiguous. |
The smallest error code that PROJ can (should) return is 1024, so anything smaller than that should be a panic. |
bors try |
tryBuild failed: |
It's possible that libproj will return a null pointer instead of an actual error string. In this case we now return a specific error indicating this. Fixes georust#73
For some reason the proj@7 formula doesn't seem to play nicely with pkg-config, so gonna revert that change and hold off on merging this until the update to PROJ 8.1.0 has landed. |
Hmmm... I'm pretty sure I had the LMK if you'd like me to test anything locally on my mac. |
It's possible that libproj will return a null pointer instead of an
actual error string. In this case we now return a specific error
indicating this.
Fixes #73