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

Create enum of error numbers #424

Closed
rossmills99 opened this issue Sep 15, 2022 · 0 comments · Fixed by #447
Closed

Create enum of error numbers #424

rossmills99 opened this issue Sep 15, 2022 · 0 comments · Fixed by #447

Comments

@rossmills99
Copy link
Collaborator

rossmills99 commented Sep 15, 2022

Previously we rejected the idea of using an enum for the ArangoDB error codes, see: #15

However it would still be useful to include an enum in the repository that can be used for doing comparisons, even if the types themselves continue to use int. This could then be used in code such as:

try
{
// do stuff
}
// cast ArangoDbErrorNum to `int` for comparison
catch (ApiErrorException ex) when (ex.ApiError.ErrorNum == (int)ArangoDbErrorNum.DocumentNotFound)
{
// handle not found
}
@tjoubert tjoubert linked a pull request Dec 13, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant