I use the Go framework to create my desired functionaliy on the server side
But the problem I have is how can I parse the errors that return to the framework from the nakama side and take appropriate action based on the type of error.
err := nk.[someFunction]
err just have Error() function that returns only one string, which contains the text, explanation, error code, etc., which cannot be used.
how to parse errors and for example:
if err.ErrCode == PermissionDenied → do some logics
else if err.ErrCode == AlreadyExists → some other logics
…
There was no difference with this new method.
I am currently trying to call nk.LinkGoogle and err.Error() is “rpc error: code = AlreadyExists desc = Google ID is already in use.”
But I don’t think there will be a change in the calling of other functions.