Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better name errors

  • Loading branch information...
commit 2d764a6e5f12814fc45cea72f84c312e2884745e 1 parent f5754f5
@camshaft authored
Showing with 5 additions and 6 deletions.
  1. +3 −3 lib/proto.js
  2. +2 −3 package.json
View
6 lib/proto.js
@@ -56,7 +56,7 @@ app.use = function use(route, name, handle) {
var middleware = defaults(route, name, handle);
if(this.indexOf(middleware.name) !== -1) {
- throw new ExistsError(name);
+ throw new ExistsError(middleware.name);
}
this.stack.push(middleware);
@@ -80,7 +80,7 @@ app.useBefore = function useBefore(beforeName, route, name, handle) {
var middleware = defaults(route, name, handle);
if(this.indexOf(middleware.name) !== -1) {
- throw new ExistsError(name);
+ throw new ExistsError(middleware.name);
}
var idx = this.indexOf(beforeName);
@@ -110,7 +110,7 @@ app.useAfter = function useAfter(afterName, route, name, handle) {
var middleware = defaults(route, name, handle);
if(this.indexOf(middleware.name) !== -1) {
- throw new ExistsError(name);
+ throw new ExistsError(middleware.name);
}
var idx = this.indexOf(afterName);
View
5 package.json
@@ -1,6 +1,6 @@
{
"name": "pack-n-stack",
- "version": "0.1.0",
+ "version": "0.1.1",
"description": "Distributable and configurable middleware stacks",
"main": "index.js",
"scripts": {
@@ -19,8 +19,7 @@
],
"author": "Cameron Bytheway <cameron@nujii.com>",
"license": "MIT",
- "dependencies": {
- },
+ "dependencies": {},
"devDependencies": {
"connect": "~2.7.1",
"async": "~0.1.22",
Please sign in to comment.
Something went wrong with that request. Please try again.