Merge branch 'error-handling'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parents abf5d66, f850fa6 · Browse files · 3 files·+9 added−7 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+9 added−7 removed
- other:+9 added−7 removed
Provenance
- Commit
7591834- Tree
d3e3d8b- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent 1
abf5d66- Parent 2
f850fa6
3 files changed+9 added−7 removed
modified:lib/express/plugins/cookie.js+2 added-1 removed
101 unmodified linesExpand all102103104105106106107108109110111101 unmodified linesExpand all * Set the Set-Cookie header when response cookies are available. */ response: function(event) { if (event.response.cookies.length) if (event.response.cookies && event.response.cookies.length) event.request.header('set-cookie', event.response.cookies.join(', ')) } }})No newline at end of fileNo newline at end of filemodified:lib/express/plugins/logger.js+1 added-1 removed
72 unmodified lines7374757677777879808172 unmodified lines * Output log data. */ response: function(event) { formats[exports.Logger.format || 'common'](event, this.start) formats[exports.Logger.format || 'common'](event, this.start || Number(new Date)) sys.print('\n') } }})No newline at end of fileNo newline at end of filemodified:lib/express/core.js+6 added-5 removed
220 unmodified lines221 require('http')222 .createServer(function(request, response){223 request.body = ''224 request.setBodyEncoding('binary')225- var pendingFiles226- 227- function callback(err, result) { 225+ function callback(err) {226+ if (!(request instanceof Request))227+ request = new Request(request, response)228 if (err)229 Express.error(err, request, response)230 else if (!pendingFiles)231 self.route(request, response)7 unmodified lines239 .addListener('partBegin', function(part) { 240 if (part.filename)241 ++pendingFiles,242 part.tempfile = '/tmp/express-' + Number(new Date) + utils.uid(),243- part.fileStream = fs.createWriteStream(part.tempfile)243+ part.fileStream = fs.createWriteStream(part.tempfile),244+ part.fileStream.addListener('error', callback)245 else246 part.buf = ''247 })248 .addListener('body', function(chunk) {34 unmodified lines283 */284 285 route: function(request, response){ 286 var self = this,286- request = new Request(request, response) 287+ request = new Request(request, response)288 request.trigger('request', function(err) {289 try {290 if (err) throw err291 if (request.response.finished) return64 unmodified lines