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

Error when server is down #27

Closed
GreenArrow18 opened this issue Oct 2, 2019 · 3 comments
Closed

Error when server is down #27

GreenArrow18 opened this issue Oct 2, 2019 · 3 comments
Assignees

Comments

@GreenArrow18
Copy link

GreenArrow18 commented Oct 2, 2019

I'm trying to catch connection errors so that I can display the appropriate error messages on the client side.

Assume the server is currently not available. Two issues I encountered:

  1. What is the proper way to set the connection time out? From the example code, I am using this:
    ColyseusConnection.config = { connect_timeout = 3 }

However, that does not appear to work correctly. My test script always times out at 10 seconds, even if I specified a different value as above. Looking at the client.lua code I see this:
end, headers, body or "", { timeout = 10 })
so it seems like the connection timeout is currently fixed at 10 sec?

  1. I am expecting on:error callback to be called if the server is unavailable, but I am getting script errors on client.lua:
WARNING:DLIB: Profiler Message.Dispatch @__http_worker_0 took 10.004 seconds
ERROR:SCRIPT: /colyseus/client.lua:132: attempt to index local 'data' (a boolean value)
stack traceback:
	/colyseus/client.lua:132: in function </colyseus/client.lua:127>

Thoughts?

@endel
Copy link
Member

endel commented Oct 2, 2019

Hi @GreenArrow18, I'm gonna check this later today, thanks for letting me know! You can expect the callback to be triggered with and err message filled in.

@endel endel self-assigned this Oct 2, 2019
endel added a commit that referenced this issue Oct 3, 2019
@endel
Copy link
Member

endel commented Oct 3, 2019

Hi @GreenArrow18, can you check if it works for you now? I've just created a new release here on GitHub: https://github.com/colyseus/colyseus-defold/releases/tag/0.11.5

Thanks for reporting! Cheers!

@GreenArrow18
Copy link
Author

Hi Endel, just did a quick test and I can confirm that both issues are fixed now.

Thanks!

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

2 participants