You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My question is how should the error code be accessed?
HasErrorNum will not work, since it requires a numberedError as input, and casting to statusCodedError to access the error attribute doesn't work, since statusCodedError is not exported.
Current result of arangolite.HasStatusCode(err) is 409, but arangolite.HasErrorNum(e_status, 1207) gives false.
The text was updated successfully, but these errors were encountered:
Well the answer is quite simple. I just messed up my wrapping :)
Could you try again with the tip? It should be fixed now.
I also added some GetErrorNum and GetStatusCode functions to allow better debugging.
When performing a
CreateDatabase
where the database already exists, the database returns error code 1207 (https://docs.arangodb.com/3.0/Manual/Appendix/ErrorCodes.html, ERROR_ARANGO_DUPLICATE_NAME).This error code is wrapped in a
numberedError
at https://github.com/solher/arangolite/blob/v2.0.1/database.go#L207However, at the next step, the
numberedError
is wrapped in astatusCodedError
at https://github.com/solher/arangolite/blob/v2.0.1/database.go#L213The
statusCodedError
is what is returned bySend
.My question is how should the error code be accessed?
HasErrorNum
will not work, since it requires anumberedError
as input, and casting tostatusCodedError
to access theerror
attribute doesn't work, sincestatusCodedError
is not exported.Current result of
arangolite.HasStatusCode(err)
is 409, butarangolite.HasErrorNum(e_status, 1207)
gives false.The text was updated successfully, but these errors were encountered: