{"action":"created","comment":{"url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/comments/41995094","id":41995094,"diff_hunk":"@@ -89,6 +89,20 @@ function applyDefaultAccountFields(config,req) {\n     req.body.surname = 'Anonymous';\n   }\n }\n+/**","path":"lib/controllers/register.js","position":4,"original_position":4,"commit_id":"43f404ec1cabb547ca48aded9142ba441b77b3b0","original_commit_id":"43f404ec1cabb547ca48aded9142ba441b77b3b0","user":{"login":"robertjd","id":132343,"avatar_url":"https://avatars.githubusercontent.com/u/132343?v=3","gravatar_id":"","url":"https://api.github.com/users/robertjd","html_url":"https://github.com/robertjd","followers_url":"https://api.github.com/users/robertjd/followers","following_url":"https://api.github.com/users/robertjd/following{/other_user}","gists_url":"https://api.github.com/users/robertjd/gists{/gist_id}","starred_url":"https://api.github.com/users/robertjd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertjd/subscriptions","organizations_url":"https://api.github.com/users/robertjd/orgs","repos_url":"https://api.github.com/users/robertjd/repos","events_url":"https://api.github.com/users/robertjd/events{/privacy}","received_events_url":"https://api.github.com/users/robertjd/received_events","type":"User","site_admin":false},"body":"I was thinking about that.  My general approach is to not move things into files until I need to require the function by multiple files.  But now I'm wondering if having it in a separate file would encourage others to notice that it's there and to start using it?  Because I do want us to get a control on error handling in this library..\r\n\r\nWhere would you put it? I image putting it in the `helpers/` folder.","created_at":"2015-10-14T13:52:23Z","updated_at":"2015-10-14T13:52:23Z","html_url":"https://github.com/stormpath/express-stormpath/pull/149#discussion_r41995094","pull_request_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/149","_links":{"self":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/comments/41995094"},"html":{"href":"https://github.com/stormpath/express-stormpath/pull/149#discussion_r41995094"},"pull_request":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/149"}}},"pull_request":{"url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/149","id":47599540,"html_url":"https://github.com/stormpath/express-stormpath/pull/149","diff_url":"https://github.com/stormpath/express-stormpath/pull/149.diff","patch_url":"https://github.com/stormpath/express-stormpath/pull/149.patch","issue_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/149","number":149,"state":"open","locked":false,"title":"Fixing JSON error responses in registration controller","user":{"login":"robertjd","id":132343,"avatar_url":"https://avatars.githubusercontent.com/u/132343?v=3","gravatar_id":"","url":"https://api.github.com/users/robertjd","html_url":"https://github.com/robertjd","followers_url":"https://api.github.com/users/robertjd/followers","following_url":"https://api.github.com/users/robertjd/following{/other_user}","gists_url":"https://api.github.com/users/robertjd/gists{/gist_id}","starred_url":"https://api.github.com/users/robertjd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertjd/subscriptions","organizations_url":"https://api.github.com/users/robertjd/orgs","repos_url":"https://api.github.com/users/robertjd/repos","events_url":"https://api.github.com/users/robertjd/events{/privacy}","received_events_url":"https://api.github.com/users/robertjd/received_events","type":"User","site_admin":false},"body":"Pass through the error from the underlying SDK","created_at":"2015-10-13T22:56:25Z","updated_at":"2015-10-14T13:52:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d878bf7ffcd5c2d965c5eca98d60aa3d7dd62ace","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/149/commits","review_comments_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/149/comments","review_comment_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/149/comments","statuses_url":"https://api.github.com/repos/stormpath/express-stormpath/statuses/43f404ec1cabb547ca48aded9142ba441b77b3b0","head":{"label":"stormpath:fix-registration-json-errors","ref":"fix-registration-json-errors","sha":"43f404ec1cabb547ca48aded9142ba441b77b3b0","user":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"repo":{"id":21433270,"name":"express-stormpath","full_name":"stormpath/express-stormpath","owner":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stormpath/express-stormpath","description":"Build simple, secure web applications with Stormpath and Express!","fork":false,"url":"https://api.github.com/repos/stormpath/express-stormpath","forks_url":"https://api.github.com/repos/stormpath/express-stormpath/forks","keys_url":"https://api.github.com/repos/stormpath/express-stormpath/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpath/express-stormpath/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpath/express-stormpath/teams","hooks_url":"https://api.github.com/repos/stormpath/express-stormpath/hooks","issue_events_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/events{/number}","events_url":"https://api.github.com/repos/stormpath/express-stormpath/events","assignees_url":"https://api.github.com/repos/stormpath/express-stormpath/assignees{/user}","branches_url":"https://api.github.com/repos/stormpath/express-stormpath/branches{/branch}","tags_url":"https://api.github.com/repos/stormpath/express-stormpath/tags","blobs_url":"https://api.github.com/repos/stormpath/express-stormpath/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpath/express-stormpath/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpath/express-stormpath/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpath/express-stormpath/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpath/express-stormpath/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpath/express-stormpath/languages","stargazers_url":"https://api.github.com/repos/stormpath/express-stormpath/stargazers","contributors_url":"https://api.github.com/repos/stormpath/express-stormpath/contributors","subscribers_url":"https://api.github.com/repos/stormpath/express-stormpath/subscribers","subscription_url":"https://api.github.com/repos/stormpath/express-stormpath/subscription","commits_url":"https://api.github.com/repos/stormpath/express-stormpath/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpath/express-stormpath/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpath/express-stormpath/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpath/express-stormpath/contents/{+path}","compare_url":"https://api.github.com/repos/stormpath/express-stormpath/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpath/express-stormpath/merges","archive_url":"https://api.github.com/repos/stormpath/express-stormpath/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpath/express-stormpath/downloads","issues_url":"https://api.github.com/repos/stormpath/express-stormpath/issues{/number}","pulls_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpath/express-stormpath/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpath/express-stormpath/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpath/express-stormpath/labels{/name}","releases_url":"https://api.github.com/repos/stormpath/express-stormpath/releases{/id}","created_at":"2014-07-02T17:25:41Z","updated_at":"2015-10-14T03:59:08Z","pushed_at":"2015-10-14T08:04:00Z","git_url":"git://github.com/stormpath/express-stormpath.git","ssh_url":"git@github.com:stormpath/express-stormpath.git","clone_url":"https://github.com/stormpath/express-stormpath.git","svn_url":"https://github.com/stormpath/express-stormpath","homepage":"http://docs.stormpath.com/nodejs/express/","size":12461,"stargazers_count":107,"watchers_count":107,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":34,"forks":44,"open_issues":34,"watchers":107,"default_branch":"master"}},"base":{"label":"stormpath:master","ref":"master","sha":"f2b4c58f28602c8fe7a249db288260ba9e533240","user":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"repo":{"id":21433270,"name":"express-stormpath","full_name":"stormpath/express-stormpath","owner":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stormpath/express-stormpath","description":"Build simple, secure web applications with Stormpath and Express!","fork":false,"url":"https://api.github.com/repos/stormpath/express-stormpath","forks_url":"https://api.github.com/repos/stormpath/express-stormpath/forks","keys_url":"https://api.github.com/repos/stormpath/express-stormpath/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpath/express-stormpath/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpath/express-stormpath/teams","hooks_url":"https://api.github.com/repos/stormpath/express-stormpath/hooks","issue_events_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/events{/number}","events_url":"https://api.github.com/repos/stormpath/express-stormpath/events","assignees_url":"https://api.github.com/repos/stormpath/express-stormpath/assignees{/user}","branches_url":"https://api.github.com/repos/stormpath/express-stormpath/branches{/branch}","tags_url":"https://api.github.com/repos/stormpath/express-stormpath/tags","blobs_url":"https://api.github.com/repos/stormpath/express-stormpath/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpath/express-stormpath/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpath/express-stormpath/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpath/express-stormpath/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpath/express-stormpath/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpath/express-stormpath/languages","stargazers_url":"https://api.github.com/repos/stormpath/express-stormpath/stargazers","contributors_url":"https://api.github.com/repos/stormpath/express-stormpath/contributors","subscribers_url":"https://api.github.com/repos/stormpath/express-stormpath/subscribers","subscription_url":"https://api.github.com/repos/stormpath/express-stormpath/subscription","commits_url":"https://api.github.com/repos/stormpath/express-stormpath/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpath/express-stormpath/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpath/express-stormpath/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpath/express-stormpath/contents/{+path}","compare_url":"https://api.github.com/repos/stormpath/express-stormpath/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpath/express-stormpath/merges","archive_url":"https://api.github.com/repos/stormpath/express-stormpath/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpath/express-stormpath/downloads","issues_url":"https://api.github.com/repos/stormpath/express-stormpath/issues{/number}","pulls_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpath/express-stormpath/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpath/express-stormpath/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpath/express-stormpath/labels{/name}","releases_url":"https://api.github.com/repos/stormpath/express-stormpath/releases{/id}","created_at":"2014-07-02T17:25:41Z","updated_at":"2015-10-14T03:59:08Z","pushed_at":"2015-10-14T08:04:00Z","git_url":"git://github.com/stormpath/express-stormpath.git","ssh_url":"git@github.com:stormpath/express-stormpath.git","clone_url":"https://github.com/stormpath/express-stormpath.git","svn_url":"https://github.com/stormpath/express-stormpath","homepage":"http://docs.stormpath.com/nodejs/express/","size":12461,"stargazers_count":107,"watchers_count":107,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":34,"forks":44,"open_issues":34,"watchers":107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/149"},"html":{"href":"https://github.com/stormpath/express-stormpath/pull/149"},"issue":{"href":"https://api.github.com/repos/stormpath/express-stormpath/issues/149"},"comments":{"href":"https://api.github.com/repos/stormpath/express-stormpath/issues/149/comments"},"review_comments":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/149/comments"},"review_comment":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/149/commits"},"statuses":{"href":"https://api.github.com/repos/stormpath/express-stormpath/statuses/43f404ec1cabb547ca48aded9142ba441b77b3b0"}}}}