alexmingoia/koa-router — pull request #71 by fengmk2 (2014-07-17 09:32:52+00:00)
Title: Show friendly error message when usage wrong.

`app.get('/foo', notexistHandle)` should throw error more friendly message, not this

```log
TypeError: Cannot call method 'concat' of undefined
at pathtoRegexp (/Users/mk2/git/koa-router/node_modules/path-to-regexp/index.js:33:6)
at new Route (/Users/mk2/git/koa-router/lib/route.js:42:19)
at Router.router.register (/Users/mk2/git/koa-router/lib/router.js:213:15)
at Router.router.(anonymous function) [as get] (/Users/mk2/git/koa-router/lib/router.js:138:19)
at Context. (/Users/mk2/git/koa-router/test/lib/route.js:160:11)
```

should be better:

```log
TypeError: register get `/foo` router error, `middleware` must be a function, not `undefined`
at Router.router.(anonymous function) [as get] (/Users/mk2/git/koa-router/lib/router.js:131:15)
at Context. (/Users/mk2/git/koa-router/test/lib/route.js:160:11)
at Test.Runnable.run (/Users/mk2/git/koa-router/node_modules/mocha/lib/runnable.js:221:32)
at Runner.runTest (/Users/mk2/git/koa-router/node_modules/mocha/lib/runner.js:374:10)
at /Users/mk2/git/koa-router/node_modules/mocha/lib/runner.js:452:12
```