Skip to content
Myr

Error stack now includes routes originalPath

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

authored by visionmedia · committed by visionmedia · parent e4bb8d3 · Browse files · 3 files+20 added−3 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+20 added−3 removed

  • tests:+14 added−2 removed
  • other:+6 added−1 removed

3 files+20 added−3 removed

modified:lib/express/core.js+6 added-1 removed
6 unmodified lines
78Route = Class({9 init: function(method, path, fn, options){10 this.method = method11 this.originalPath = path12 this.path = pathToRegexp(normalizePath(path))13 this.fn = fn14 },15 run: function(){15 return process.compile('with(Express.helpers){ (' + this.fn + ')() }', this.method + '(' + this.path + ')')16 return process.compile('with(Express.helpers){ (' + this.fn + ')() }', this.method + '(' + jsonEncode(this.originalPath) + ')')17 }18})1920// --- Router
85 unmodified lines
106param = function(key) {107 return Express.server.router.params[key]108}109110jsonEncode = function(object) {111 return JSON.stringify(object)112}113114/**115 * Escape special characters in _html_.116 *117 * @param {string} html
106 unmodified lines
modified:spec/spec.core.helpers.js+11 added
modified:spec/spec.core.routing.js+3 added-2 removed