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

[Feature Request] JavaScript: stable error codes #920

Open
vyacheslav-sozap opened this issue Sep 29, 2022 · 0 comments
Open

[Feature Request] JavaScript: stable error codes #920

vyacheslav-sozap opened this issue Sep 29, 2022 · 0 comments

Comments

@vyacheslav-sozap
Copy link

Right now, catching errors from Nakama JavaScript API looks like this:

try {
    nk.linkDevice(userId, deviceId);
} catch (e) {
    if (e.message == 'error linking: rpc error: code = AlreadyExists desc = Device ID already in use.') {
        //make processing
    }
}

Obviously, the problem with such code is that message format might (and already did) change on Nakama update, so it would be nice to have some error code inside throwable object.

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

1 participant