examples: improve 404 message wording

closes #4471
This commit is contained in:
Aalaap Ghag
2020-11-29 09:41:16 +05:30
committed by Douglas Christopher Wilson
parent a24f27aba7
commit 21cf522dcd
2 changed files with 4 additions and 4 deletions

View File

@@ -105,7 +105,7 @@ app.use(function(err, req, res, next){
// invoke next() and do not respond.
app.use(function(req, res){
res.status(404);
res.send({ error: "Lame, can't find that" });
res.send({ error: "Sorry, can't find that" })
});
/* istanbul ignore next */

View File

@@ -97,9 +97,9 @@ describe('web-service', function(){
describe('when requesting an invalid route', function(){
it('should respond with 404 json', function(done){
request(app)
.get('/api/something?api-key=bar')
.expect('Content-Type', /json/)
.expect(404, '{"error":"Lame, can\'t find that"}', done)
.get('/api/something?api-key=bar')
.expect('Content-Type', /json/)
.expect(404, '{"error":"Sorry, can\'t find that"}', done)
})
})
})