{"action":"created","comment":{"url":"https://api.github.com/repos/koajs/trie-router/pulls/comments/42816410","id":42816410,"diff_hunk":"@@ -4,7 +4,12 @@ Router.prototype.dispatcher = function () {\n   var trie = this.trie\n \n   return function* trieRouter (next) {\n-    var match = trie.match(this.request.path)\n+    try {\n+      var match = trie.match(this.request.path)\n+    } catch (err) {\n+      err.code = 1101;","path":"lib/dispatcher.js","position":8,"original_position":8,"commit_id":"4a7d7a4454d372a92d6a60fd72901c0694c80b33","original_commit_id":"4a7d7a4454d372a92d6a60fd72901c0694c80b33","user":{"login":"jonathanong","id":643505,"avatar_url":"https://avatars.githubusercontent.com/u/643505?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathanong","html_url":"https://github.com/jonathanong","followers_url":"https://api.github.com/users/jonathanong/followers","following_url":"https://api.github.com/users/jonathanong/following{/other_user}","gists_url":"https://api.github.com/users/jonathanong/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathanong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathanong/subscriptions","organizations_url":"https://api.github.com/users/jonathanong/orgs","repos_url":"https://api.github.com/users/jonathanong/repos","events_url":"https://api.github.com/users/jonathanong/events{/privacy}","received_events_url":"https://api.github.com/users/jonathanong/received_events","type":"User","site_admin":false},"body":"also got to test that the `.code` is actually returned","created_at":"2015-10-22T22:51:31Z","updated_at":"2015-10-22T22:51:31Z","html_url":"https://github.com/koajs/trie-router/pull/22#discussion_r42816410","pull_request_url":"https://api.github.com/repos/koajs/trie-router/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/koajs/trie-router/pulls/comments/42816410"},"html":{"href":"https://github.com/koajs/trie-router/pull/22#discussion_r42816410"},"pull_request":{"href":"https://api.github.com/repos/koajs/trie-router/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/koajs/trie-router/pulls/22","id":48501479,"html_url":"https://github.com/koajs/trie-router/pull/22","diff_url":"https://github.com/koajs/trie-router/pull/22.diff","patch_url":"https://github.com/koajs/trie-router/pull/22.patch","issue_url":"https://api.github.com/repos/koajs/trie-router/issues/22","number":22,"state":"open","locked":false,"title":"Throw 404 with specific err.code so catchable upstream","user":{"login":"tejasmanohar","id":5959235,"avatar_url":"https://avatars.githubusercontent.com/u/5959235?v=3","gravatar_id":"","url":"https://api.github.com/users/tejasmanohar","html_url":"https://github.com/tejasmanohar","followers_url":"https://api.github.com/users/tejasmanohar/followers","following_url":"https://api.github.com/users/tejasmanohar/following{/other_user}","gists_url":"https://api.github.com/users/tejasmanohar/gists{/gist_id}","starred_url":"https://api.github.com/users/tejasmanohar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejasmanohar/subscriptions","organizations_url":"https://api.github.com/users/tejasmanohar/orgs","repos_url":"https://api.github.com/users/tejasmanohar/repos","events_url":"https://api.github.com/users/tejasmanohar/events{/privacy}","received_events_url":"https://api.github.com/users/tejasmanohar/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-22T19:28:43Z","updated_at":"2015-10-22T22:51:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8fe34b55ecf45a38892c0dccb0f4cfe158b2df2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/koajs/trie-router/pulls/22/commits","review_comments_url":"https://api.github.com/repos/koajs/trie-router/pulls/22/comments","review_comment_url":"https://api.github.com/repos/koajs/trie-router/pulls/comments{/number}","comments_url":"https://api.github.com/repos/koajs/trie-router/issues/22/comments","statuses_url":"https://api.github.com/repos/koajs/trie-router/statuses/4a7d7a4454d372a92d6a60fd72901c0694c80b33","head":{"label":"koajs:err_on_malformed_url","ref":"err_on_malformed_url","sha":"4a7d7a4454d372a92d6a60fd72901c0694c80b33","user":{"login":"koajs","id":5055057,"avatar_url":"https://avatars.githubusercontent.com/u/5055057?v=3","gravatar_id":"","url":"https://api.github.com/users/koajs","html_url":"https://github.com/koajs","followers_url":"https://api.github.com/users/koajs/followers","following_url":"https://api.github.com/users/koajs/following{/other_user}","gists_url":"https://api.github.com/users/koajs/gists{/gist_id}","starred_url":"https://api.github.com/users/koajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koajs/subscriptions","organizations_url":"https://api.github.com/users/koajs/orgs","repos_url":"https://api.github.com/users/koajs/repos","events_url":"https://api.github.com/users/koajs/events{/privacy}","received_events_url":"https://api.github.com/users/koajs/received_events","type":"Organization","site_admin":false},"repo":{"id":14417887,"name":"trie-router","full_name":"koajs/trie-router","owner":{"login":"koajs","id":5055057,"avatar_url":"https://avatars.githubusercontent.com/u/5055057?v=3","gravatar_id":"","url":"https://api.github.com/users/koajs","html_url":"https://github.com/koajs","followers_url":"https://api.github.com/users/koajs/followers","following_url":"https://api.github.com/users/koajs/following{/other_user}","gists_url":"https://api.github.com/users/koajs/gists{/gist_id}","starred_url":"https://api.github.com/users/koajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koajs/subscriptions","organizations_url":"https://api.github.com/users/koajs/orgs","repos_url":"https://api.github.com/users/koajs/repos","events_url":"https://api.github.com/users/koajs/events{/privacy}","received_events_url":"https://api.github.com/users/koajs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/koajs/trie-router","description":"Trie-routing for Koa","fork":false,"url":"https://api.github.com/repos/koajs/trie-router","forks_url":"https://api.github.com/repos/koajs/trie-router/forks","keys_url":"https://api.github.com/repos/koajs/trie-router/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koajs/trie-router/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koajs/trie-router/teams","hooks_url":"https://api.github.com/repos/koajs/trie-router/hooks","issue_events_url":"https://api.github.com/repos/koajs/trie-router/issues/events{/number}","events_url":"https://api.github.com/repos/koajs/trie-router/events","assignees_url":"https://api.github.com/repos/koajs/trie-router/assignees{/user}","branches_url":"https://api.github.com/repos/koajs/trie-router/branches{/branch}","tags_url":"https://api.github.com/repos/koajs/trie-router/tags","blobs_url":"https://api.github.com/repos/koajs/trie-router/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koajs/trie-router/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koajs/trie-router/git/refs{/sha}","trees_url":"https://api.github.com/repos/koajs/trie-router/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koajs/trie-router/statuses/{sha}","languages_url":"https://api.github.com/repos/koajs/trie-router/languages","stargazers_url":"https://api.github.com/repos/koajs/trie-router/stargazers","contributors_url":"https://api.github.com/repos/koajs/trie-router/contributors","subscribers_url":"https://api.github.com/repos/koajs/trie-router/subscribers","subscription_url":"https://api.github.com/repos/koajs/trie-router/subscription","commits_url":"https://api.github.com/repos/koajs/trie-router/commits{/sha}","git_commits_url":"https://api.github.com/repos/koajs/trie-router/git/commits{/sha}","comments_url":"https://api.github.com/repos/koajs/trie-router/comments{/number}","issue_comment_url":"https://api.github.com/repos/koajs/trie-router/issues/comments{/number}","contents_url":"https://api.github.com/repos/koajs/trie-router/contents/{+path}","compare_url":"https://api.github.com/repos/koajs/trie-router/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koajs/trie-router/merges","archive_url":"https://api.github.com/repos/koajs/trie-router/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koajs/trie-router/downloads","issues_url":"https://api.github.com/repos/koajs/trie-router/issues{/number}","pulls_url":"https://api.github.com/repos/koajs/trie-router/pulls{/number}","milestones_url":"https://api.github.com/repos/koajs/trie-router/milestones{/number}","notifications_url":"https://api.github.com/repos/koajs/trie-router/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koajs/trie-router/labels{/name}","releases_url":"https://api.github.com/repos/koajs/trie-router/releases{/id}","created_at":"2013-11-15T07:32:32Z","updated_at":"2015-10-22T19:38:01Z","pushed_at":"2015-10-22T22:49:19Z","git_url":"git://github.com/koajs/trie-router.git","ssh_url":"git@github.com:koajs/trie-router.git","clone_url":"https://github.com/koajs/trie-router.git","svn_url":"https://github.com/koajs/trie-router","homepage":null,"size":247,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":9,"forks":7,"open_issues":9,"watchers":61,"default_branch":"master"}},"base":{"label":"koajs:master","ref":"master","sha":"c9304e670e2669ed1133064471c247d18bed8af0","user":{"login":"koajs","id":5055057,"avatar_url":"https://avatars.githubusercontent.com/u/5055057?v=3","gravatar_id":"","url":"https://api.github.com/users/koajs","html_url":"https://github.com/koajs","followers_url":"https://api.github.com/users/koajs/followers","following_url":"https://api.github.com/users/koajs/following{/other_user}","gists_url":"https://api.github.com/users/koajs/gists{/gist_id}","starred_url":"https://api.github.com/users/koajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koajs/subscriptions","organizations_url":"https://api.github.com/users/koajs/orgs","repos_url":"https://api.github.com/users/koajs/repos","events_url":"https://api.github.com/users/koajs/events{/privacy}","received_events_url":"https://api.github.com/users/koajs/received_events","type":"Organization","site_admin":false},"repo":{"id":14417887,"name":"trie-router","full_name":"koajs/trie-router","owner":{"login":"koajs","id":5055057,"avatar_url":"https://avatars.githubusercontent.com/u/5055057?v=3","gravatar_id":"","url":"https://api.github.com/users/koajs","html_url":"https://github.com/koajs","followers_url":"https://api.github.com/users/koajs/followers","following_url":"https://api.github.com/users/koajs/following{/other_user}","gists_url":"https://api.github.com/users/koajs/gists{/gist_id}","starred_url":"https://api.github.com/users/koajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koajs/subscriptions","organizations_url":"https://api.github.com/users/koajs/orgs","repos_url":"https://api.github.com/users/koajs/repos","events_url":"https://api.github.com/users/koajs/events{/privacy}","received_events_url":"https://api.github.com/users/koajs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/koajs/trie-router","description":"Trie-routing for Koa","fork":false,"url":"https://api.github.com/repos/koajs/trie-router","forks_url":"https://api.github.com/repos/koajs/trie-router/forks","keys_url":"https://api.github.com/repos/koajs/trie-router/keys{/key_id}","collaborators_url":"https://api.github.com/repos/koajs/trie-router/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/koajs/trie-router/teams","hooks_url":"https://api.github.com/repos/koajs/trie-router/hooks","issue_events_url":"https://api.github.com/repos/koajs/trie-router/issues/events{/number}","events_url":"https://api.github.com/repos/koajs/trie-router/events","assignees_url":"https://api.github.com/repos/koajs/trie-router/assignees{/user}","branches_url":"https://api.github.com/repos/koajs/trie-router/branches{/branch}","tags_url":"https://api.github.com/repos/koajs/trie-router/tags","blobs_url":"https://api.github.com/repos/koajs/trie-router/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/koajs/trie-router/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/koajs/trie-router/git/refs{/sha}","trees_url":"https://api.github.com/repos/koajs/trie-router/git/trees{/sha}","statuses_url":"https://api.github.com/repos/koajs/trie-router/statuses/{sha}","languages_url":"https://api.github.com/repos/koajs/trie-router/languages","stargazers_url":"https://api.github.com/repos/koajs/trie-router/stargazers","contributors_url":"https://api.github.com/repos/koajs/trie-router/contributors","subscribers_url":"https://api.github.com/repos/koajs/trie-router/subscribers","subscription_url":"https://api.github.com/repos/koajs/trie-router/subscription","commits_url":"https://api.github.com/repos/koajs/trie-router/commits{/sha}","git_commits_url":"https://api.github.com/repos/koajs/trie-router/git/commits{/sha}","comments_url":"https://api.github.com/repos/koajs/trie-router/comments{/number}","issue_comment_url":"https://api.github.com/repos/koajs/trie-router/issues/comments{/number}","contents_url":"https://api.github.com/repos/koajs/trie-router/contents/{+path}","compare_url":"https://api.github.com/repos/koajs/trie-router/compare/{base}...{head}","merges_url":"https://api.github.com/repos/koajs/trie-router/merges","archive_url":"https://api.github.com/repos/koajs/trie-router/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/koajs/trie-router/downloads","issues_url":"https://api.github.com/repos/koajs/trie-router/issues{/number}","pulls_url":"https://api.github.com/repos/koajs/trie-router/pulls{/number}","milestones_url":"https://api.github.com/repos/koajs/trie-router/milestones{/number}","notifications_url":"https://api.github.com/repos/koajs/trie-router/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/koajs/trie-router/labels{/name}","releases_url":"https://api.github.com/repos/koajs/trie-router/releases{/id}","created_at":"2013-11-15T07:32:32Z","updated_at":"2015-10-22T19:38:01Z","pushed_at":"2015-10-22T22:49:19Z","git_url":"git://github.com/koajs/trie-router.git","ssh_url":"git@github.com:koajs/trie-router.git","clone_url":"https://github.com/koajs/trie-router.git","svn_url":"https://github.com/koajs/trie-router","homepage":null,"size":247,"stargazers_count":61,"watchers_count":61,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":9,"forks":7,"open_issues":9,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/koajs/trie-router/pulls/22"},"html":{"href":"https://github.com/koajs/trie-router/pull/22"},"issue":{"href":"https://api.github.com/repos/koajs/trie-router/issues/22"},"comments":{"href":"https://api.github.com/repos/koajs/trie-router/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/koajs/trie-router/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/koajs/trie-router/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/koajs/trie-router/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/koajs/trie-router/statuses/4a7d7a4454d372a92d6a60fd72901c0694c80b33"}}}}