Skip to content

Commit

Permalink
Fix stripping of connection error message with unix sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandro Santilli committed Mar 13, 2014
1 parent 1b20c3e commit 1dcd6cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/windshaft/server.js
Expand Up @@ -387,6 +387,8 @@ module.exports = function(opts){
// See https://github.com/CartoDB/Windshaft/issues/173
err = JSON.stringify(err);
err = err.replace(/Connection string: '[^']*'\\n/, '');
// See https://travis-ci.org/CartoDB/Windshaft/jobs/20703062#L1644
err = err.replace(/is the server.*encountered/im, 'encountered');
err = JSON.parse(err);

app.sendResponse(res, [err, statusCode]);
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/server_gettile.js
Expand Up @@ -925,7 +925,7 @@ suite('server_gettile', function() {
var parsed = JSON.parse(res.body);
assert.ok(parsed.error);
var msg = parsed.error;
assert.ok(msg.match(/connection/), msg);
assert.ok(msg.match(/connect/), msg);
assert.ok(!msg.match(/666/), msg);
return null;
},
Expand Down

0 comments on commit 1dcd6cb

Please sign in to comment.