diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -37,9 +37,10 @@ function proxy(callback) {
     if (!socket.writable) {
       return socket.destroy(err);
     }
-    var stack = util.getErrorStack('clientError: Bad request');
-    var code = err && err.code === 'HPE_HEADER_OVERFLOW' ? 431 : 400;
-    socket.end('HTTP/1.1 ' + code + ' Bad Request\r\n\r\n' + stack);
+    var errCode = err && err.code;
+    var statusCode = errCode === 'HPE_HEADER_OVERFLOW' ? 431 : 400;
+    var stack = util.getErrorStack('clientError: Bad request' + (errCode ? ' (' + errCode + ')' : ''));
+    socket.end('HTTP/1.1 ' + statusCode + ' Bad Request\r\n\r\n' + stack);
   });
   initSocketMgr(proxyEvents);
   setupHttps(server, proxyEvents);
refactor: clientError