diff --git a/NEWS.md b/NEWS.md index e18ec99c..f6ade61a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ ------------------ * Add 'user_from_host' directive to generalize username extraction (#124) +* Enhance error message on unknown cartodb username (#126) 1.7.1 - 2013-12-02 ------------------ diff --git a/app/controllers/app.js b/app/controllers/app.js index b5a22d31..bd1d0e09 100755 --- a/app/controllers/app.js +++ b/app/controllers/app.js @@ -197,7 +197,8 @@ function handleQuery(req, res) { if (err) { // If the database could not be found, the user is non-existant if ( err.message.match('missing') ) { - err.message = "Sorry, we can't find this CartoDB. Please check that you have entered the correct domain."; + err.message = "Sorry, we can't find CartoDB user '" + cdbuser + + "'. Please check that you have entered the correct domain."; err.http_status = 404; } throw err; diff --git a/test/acceptance/app.test.js b/test/acceptance/app.test.js index 0bd637ca..dd49b0bb 100644 --- a/test/acceptance/app.test.js +++ b/test/acceptance/app.test.js @@ -902,7 +902,7 @@ test('GET decent error if domain is incorrect', function(done){ assert.deepEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.deepEqual(res.headers['content-disposition'], 'inline'); var result = JSON.parse(res.body); - assert.equal(result.error[0],"Sorry, we can't find this CartoDB. Please check that you have entered the correct domain."); + assert.equal(result.error[0],"Sorry, we can't find CartoDB user 'vizzualinot'. Please check that you have entered the correct domain."); done(); }); });