better errors

This commit is contained in:
AlexKvazos
2015-04-30 00:58:48 -05:00
parent 29467f73b3
commit d4476e15f7
+4 -1
View File
@@ -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;