mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-23 14:48:28 +02:00
better errors
This commit is contained in:
@@ -19,11 +19,14 @@ module.exports = function(socket, sound) {
|
||||
if (typeof error === 'object') {
|
||||
switch (error.code) {
|
||||
case 'ENOTFOUND':
|
||||
error = 'The server IP could not be found.';
|
||||
error = 'The server hostname could not be resolved.';
|
||||
break;
|
||||
case 'ETIMEDOUT':
|
||||
error = 'Connection to the server timed out.';
|
||||
break;
|
||||
case 'ECONNREFUSED':
|
||||
error = 'Connection to the server has been refused.';
|
||||
break;
|
||||
default:
|
||||
error = JSON.stringify(error);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user