Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Each Error should be mapped to a different error code #3029
As mentioned in #2979 many functions return -1 for multiple errors. Take
Two different errors are mapped to -1, making them indistinguishable for the caller. This is especially problematic for bindings that map these error codes to Exceptions or some Error structure. The bindings might then throw an
Error codes should probably use -1, -2, and so on (or any other mechanism that allows for explicitness) to make exact matching for the caller possible.
I agree that mapping to different negative numbers should have no negative side-effect (comparing using
How many places are effected (next to keySetName)?
Affected, if null pointer and memory errors should be mapped to different error codes
Maybe affected, needs discussion
We should fix all of them (with consistent error values).
I think there is little benefit from this.
Is both API misuse, so same return value is ok.
This is on purpose so that a