Skip to content
Myr

Server#error() no longer requires arity of 4

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 34d10ac · Browse files · 4 files+11 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+11 added−9 removed

  • tests:+1 added−1 removed
  • other:+10 added−8 removed

4 files+11 added−9 removed

modified:examples/pages/app.js+2 added-2 removed
modified:lib/express/server.js+3 added-6 removed
73 unmodified lines
74 if (this.set('reload views')) {75 view.watcher.call(this, this.set('reload views'));76 }7778 // Custom exception handler79 if (this.errorHandler) {80 this.use('/', this.errorHandler);81 }82 78 connect.Server.prototype.listen.call(this, port);79};8081/**
25 unmodified lines
107 * @api public108 */109110Server.prototype.error = function(fn){116 this.errorHandler = fn;111 this.use('/', function(err, req, res, next){112 fn.apply(this, arguments);113 });114 return this;115};116117/**
78 unmodified lines
modified:test/express.test.js+1 added-1 removed
78 unmodified lines
79 app.get('/', function(req, res, params, next){80 next(new Error('broken'));81 });82 83 app.error(function(err, req, res, next){83 app.error(function(err, req, res){84 res.send('Shit: ' + err.message, 500);85 });86 87 assert.response(app,
108 unmodified lines
modified:.pomo+5 added
42 unmodified lines
43 complete: false44 description: 45 length: 2546 name: design mode with browser reloading47- !ruby/object:Pomo::Task 48 complete: false49 description: 50 length: 2551 name: tests for multiple error() handlers