Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server
http://dinnerbone.com/minecraft/tools/status/
1.11k stars 146 forks source link

If server is off it times out #135

Closed 9ny4 closed 3 years ago

9ny4 commented 3 years ago

How can i check if the sever is off? if status = server.status() it breaks the rest of the code so it wont get further

Iapetus-11 commented 3 years ago

Learn basic Python and how exceptions work. "it breaks the rest of the code" because it raises an exception signifying that the server isn't on, you need to catch that exception and handle it properly. https://docs.python.org/3/tutorial/errors.html

kevinkjt2000 commented 3 years ago

I'm going to open an issue about better documentation since that could explain exception handling to the masses. Edit: #136