diff --git a/lib/servers.js b/lib/servers.js index c1e911c..c5665a8 100644 --- a/lib/servers.js +++ b/lib/servers.js @@ -269,17 +269,22 @@ class ServerRegistration { } filterError (err) { + let message = 'Unknown error' + // Attempt to match to the first possible value for (const key of ['message', 'description', 'errno']) { if (err[key]) { - return { - message: err[key] - } + message = err[key] + break } } - return { - message: 'Unknown error' + + // Trim the message if too long + if (message.length > 28) { + message = message.substring(0, 28) + '...' } + + return message } }