arangodb-net-standard
arangodb-net-standard copied to clipboard
Create enum of error numbers
Previously we rejected the idea of using an enum for the ArangoDB error codes, see: https://github.com/ArangoDB-Community/arangodb-net-standard/pull/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
}