Skip to content
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

Change ErrorNum to Enum #12

Closed
AlistairB99124 opened this issue Nov 7, 2019 · 5 comments
Closed

Change ErrorNum to Enum #12

AlistairB99124 opened this issue Nov 7, 2019 · 5 comments

Comments

@AlistairB99124
Copy link
Contributor

No description provided.

@DiscoPYF
Copy link
Collaborator

DiscoPYF commented Nov 7, 2019

Are you referring to the property inside the ApiErrorResponse class? While having an enum for the ArangoDB error codes is nice, this also means one more thing to maintain and keep in sync between versions of ArangoDB. Are we willing to do that? 🤔

@DiscoPYF
Copy link
Collaborator

DiscoPYF commented Nov 7, 2019

I looked at the Java driver and they seem fine with using an int as the type: https://github.com/arangodb/arangodb-java-driver/blob/master/src/main/java/com/arangodb/entity/ErrorEntity.java

@AlistairB99124
Copy link
Contributor Author

The benefit for me is that using an enum is more descriptive and there would be less need to lookup what the error means

@rossmills99
Copy link
Collaborator

OK let's discuss this on Monday. I don't expect the error numbers to ever change, partly because there's no reason to change them. The only issue I see is new error numbers might be introduced in new versions of ArangoDB.

@rossmills99
Copy link
Collaborator

So we've decided to close this issue for now and continue using int to represent the error number. If a new version of ArangoDB introduces new error codes, there is no way to represent them in the client until you update it, if we use enum. Using int at least allows us to represent new error numbers that might be introduced with no change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants