Godot Error message list

How can I find nakama’s error message list for godot engine?

And what is the best practice to check internet connection of player with nakama?

Thanks

How can I find nakama’s error message list for godot engine?

The error messages returned by the client SDK differ slightly based on whether you’re using the client or socket features. The client features follow the REST guidelines though we return both the GRPC and HTTP status code which you can use to manage errors. i.e. 400 bad input.

For the socket error codes we’ve described them in the protocol but should improve the documentation to make it clearer without the need to look at code:

https://github.com/heroiclabs/nakama-common/blob/master/rtapi/realtime.proto#L225-L253

And what is the best practice to check internet connection of player with nakama?

You would normally not directly check whether an internet connection exists except perhaps at game client start though even that could be handled direct by an attempt to create and open a socket.

The reason not to do a separate network connectivity check is that you end up with a race condition because it’s still possible after you’ve checked that internet is valid it has become invalid before you actually open the socket (particularly possible on mobile devices). There’s very little value in a separate preflight to check.

Is there a particular reason you want to do a network check?

@novabyte

The client features follow the REST guidelines though we return both the GRPC and HTTP status code which you can use to manage errors. i.e. 400 bad input.

have follow nakama-godot tutorial, and test it myself. With the exceptionhandler script, I can print out those varies error message, such as: email is not register, password is not correct, email is not valid etc.
For translating purpose, it will be great to have those exact error message (not error code number like 400 bad input). For this reason, is there have a full list of REST error message with error code for nakama itself?

Is there a particular reason you want to do a network check?

is it relate to the previous question. Need to know when and what error have send to client, to perform suitable ui message or action(like pause the game, return to main menu or even restart the game)

could be handled direct by an attempt to create and open a socket.

A silly question, Is that only socket?or every server side call (rpc, authenticate) can also perform internet check?Since when we developing is in local environment, hard to know the different.

For translating purpose, it will be great to have those exact error message (not error code number like 400 bad input). For this reason, is there have a full list of REST error message with error code for nakama itself?

@john You want to localize the error messages returned by the server? If so I think it would be easier to request that as a feature of the server itself. We otherwise can’t guarantee that those error messages won’t change in the future to add more descriptiveness.

A silly question, Is that only socket? or every server side call (rpc, authenticate) can also perform internet check?

The SDK does not perform an internet check at all for the reasons I mentioned above. The client object sends over a request/response so you’ll want to just send the request and see if the device is connected at that point.