{"action":"created","comment":{"url":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/comments/34584914","id":34584914,"diff_hunk":"@@ -12,13 +15,27 @@ var init = require(\"./config/init\")(),\n // Bootstrap db connection\n var mongoUrl = config.mongo.protocol + config.mongo.host + \":\" +\n     config.mongo.port + \"/\" + config.mongo.database;\n-var db = mongoose.connect(mongoUrl, function(err) {\n-    if (err) {\n-        console.error(\"\\x1b[31m\", \"Could not connect to MongoDB!\");\n-        console.log(err);\n+\n+var db = mongoose.connect(mongoUrl, function (error) {\n+    if (error) {\n+        logger.error(\"Could not connect to MongoDB: %s\", error.message);\n+        throw error;\n+    }\n+    else {\n+        logger.log(\"Connected to MongoDB\");\n+        mongoose.connection.on(\"disconnected\", function () {\n+            var errorMsg = \"Lost connection to MongoDB\"; \n+            logger.error(errorMsg);\n+            throw new Error(errorMsg);","path":"server.js","position":34,"original_position":34,"commit_id":"b073a6cef7b5146ad7797f82a4d18fdeca85962d","original_commit_id":"b073a6cef7b5146ad7797f82a4d18fdeca85962d","user":{"login":"dylants","id":1596740,"avatar_url":"https://avatars.githubusercontent.com/u/1596740?v=3","gravatar_id":"","url":"https://api.github.com/users/dylants","html_url":"https://github.com/dylants","followers_url":"https://api.github.com/users/dylants/followers","following_url":"https://api.github.com/users/dylants/following{/other_user}","gists_url":"https://api.github.com/users/dylants/gists{/gist_id}","starred_url":"https://api.github.com/users/dylants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylants/subscriptions","organizations_url":"https://api.github.com/users/dylants/orgs","repos_url":"https://api.github.com/users/dylants/repos","events_url":"https://api.github.com/users/dylants/events{/privacy}","received_events_url":"https://api.github.com/users/dylants/received_events","type":"User","site_admin":false},"body":"Just a question, since we're including the `verror` module, should we use that here?  I could easily be mistaken on its use though...","created_at":"2015-07-14T16:01:03Z","updated_at":"2015-07-14T16:01:03Z","html_url":"https://github.com/CognitiveScale/meanjs-template/pull/4#discussion_r34584914","pull_request_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/comments/34584914"},"html":{"href":"https://github.com/CognitiveScale/meanjs-template/pull/4#discussion_r34584914"},"pull_request":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/4","id":39845481,"html_url":"https://github.com/CognitiveScale/meanjs-template/pull/4","diff_url":"https://github.com/CognitiveScale/meanjs-template/pull/4.diff","patch_url":"https://github.com/CognitiveScale/meanjs-template/pull/4.patch","issue_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues/4","number":4,"state":"open","locked":false,"title":"Merge in updates from protostar","user":{"login":"cappslock","id":2079125,"avatar_url":"https://avatars.githubusercontent.com/u/2079125?v=3","gravatar_id":"","url":"https://api.github.com/users/cappslock","html_url":"https://github.com/cappslock","followers_url":"https://api.github.com/users/cappslock/followers","following_url":"https://api.github.com/users/cappslock/following{/other_user}","gists_url":"https://api.github.com/users/cappslock/gists{/gist_id}","starred_url":"https://api.github.com/users/cappslock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cappslock/subscriptions","organizations_url":"https://api.github.com/users/cappslock/orgs","repos_url":"https://api.github.com/users/cappslock/repos","events_url":"https://api.github.com/users/cappslock/events{/privacy}","received_events_url":"https://api.github.com/users/cappslock/received_events","type":"User","site_admin":false},"body":"This updates the template based on some changes in protostar.","created_at":"2015-07-13T19:12:10Z","updated_at":"2015-07-14T16:01:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6864135318c633bf35ff25b512ff6a31868a6582","assignee":{"login":"dylants","id":1596740,"avatar_url":"https://avatars.githubusercontent.com/u/1596740?v=3","gravatar_id":"","url":"https://api.github.com/users/dylants","html_url":"https://github.com/dylants","followers_url":"https://api.github.com/users/dylants/followers","following_url":"https://api.github.com/users/dylants/following{/other_user}","gists_url":"https://api.github.com/users/dylants/gists{/gist_id}","starred_url":"https://api.github.com/users/dylants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylants/subscriptions","organizations_url":"https://api.github.com/users/dylants/orgs","repos_url":"https://api.github.com/users/dylants/repos","events_url":"https://api.github.com/users/dylants/events{/privacy}","received_events_url":"https://api.github.com/users/dylants/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/4/commits","review_comments_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/4/comments","review_comment_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues/4/comments","statuses_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/statuses/b073a6cef7b5146ad7797f82a4d18fdeca85962d","head":{"label":"CognitiveScale:protostar-sync","ref":"protostar-sync","sha":"b073a6cef7b5146ad7797f82a4d18fdeca85962d","user":{"login":"CognitiveScale","id":6210254,"avatar_url":"https://avatars.githubusercontent.com/u/6210254?v=3","gravatar_id":"","url":"https://api.github.com/users/CognitiveScale","html_url":"https://github.com/CognitiveScale","followers_url":"https://api.github.com/users/CognitiveScale/followers","following_url":"https://api.github.com/users/CognitiveScale/following{/other_user}","gists_url":"https://api.github.com/users/CognitiveScale/gists{/gist_id}","starred_url":"https://api.github.com/users/CognitiveScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CognitiveScale/subscriptions","organizations_url":"https://api.github.com/users/CognitiveScale/orgs","repos_url":"https://api.github.com/users/CognitiveScale/repos","events_url":"https://api.github.com/users/CognitiveScale/events{/privacy}","received_events_url":"https://api.github.com/users/CognitiveScale/received_events","type":"Organization","site_admin":false},"repo":{"id":26379388,"name":"meanjs-template","full_name":"CognitiveScale/meanjs-template","owner":{"login":"CognitiveScale","id":6210254,"avatar_url":"https://avatars.githubusercontent.com/u/6210254?v=3","gravatar_id":"","url":"https://api.github.com/users/CognitiveScale","html_url":"https://github.com/CognitiveScale","followers_url":"https://api.github.com/users/CognitiveScale/followers","following_url":"https://api.github.com/users/CognitiveScale/following{/other_user}","gists_url":"https://api.github.com/users/CognitiveScale/gists{/gist_id}","starred_url":"https://api.github.com/users/CognitiveScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CognitiveScale/subscriptions","organizations_url":"https://api.github.com/users/CognitiveScale/orgs","repos_url":"https://api.github.com/users/CognitiveScale/repos","events_url":"https://api.github.com/users/CognitiveScale/events{/privacy}","received_events_url":"https://api.github.com/users/CognitiveScale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CognitiveScale/meanjs-template","description":"A template project for a MEAN.JS style web application","fork":false,"url":"https://api.github.com/repos/CognitiveScale/meanjs-template","forks_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/forks","keys_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/teams","hooks_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/hooks","issue_events_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues/events{/number}","events_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/events","assignees_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/assignees{/user}","branches_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/branches{/branch}","tags_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/tags","blobs_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/refs{/sha}","trees_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/statuses/{sha}","languages_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/languages","stargazers_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/stargazers","contributors_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/contributors","subscribers_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/subscribers","subscription_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/subscription","commits_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/commits{/sha}","git_commits_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/commits{/sha}","comments_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/comments{/number}","issue_comment_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues/comments{/number}","contents_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/contents/{+path}","compare_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/merges","archive_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/downloads","issues_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues{/number}","pulls_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls{/number}","milestones_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/milestones{/number}","notifications_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/labels{/name}","releases_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/releases{/id}","created_at":"2014-11-09T00:20:16Z","updated_at":"2015-07-13T19:30:51Z","pushed_at":"2015-07-14T15:20:11Z","git_url":"git://github.com/CognitiveScale/meanjs-template.git","ssh_url":"git@github.com:CognitiveScale/meanjs-template.git","clone_url":"https://github.com/CognitiveScale/meanjs-template.git","svn_url":"https://github.com/CognitiveScale/meanjs-template","homepage":null,"size":288,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"CognitiveScale:master","ref":"master","sha":"982289a3ac9a34c7d5921921d0ced4b10cab4f1d","user":{"login":"CognitiveScale","id":6210254,"avatar_url":"https://avatars.githubusercontent.com/u/6210254?v=3","gravatar_id":"","url":"https://api.github.com/users/CognitiveScale","html_url":"https://github.com/CognitiveScale","followers_url":"https://api.github.com/users/CognitiveScale/followers","following_url":"https://api.github.com/users/CognitiveScale/following{/other_user}","gists_url":"https://api.github.com/users/CognitiveScale/gists{/gist_id}","starred_url":"https://api.github.com/users/CognitiveScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CognitiveScale/subscriptions","organizations_url":"https://api.github.com/users/CognitiveScale/orgs","repos_url":"https://api.github.com/users/CognitiveScale/repos","events_url":"https://api.github.com/users/CognitiveScale/events{/privacy}","received_events_url":"https://api.github.com/users/CognitiveScale/received_events","type":"Organization","site_admin":false},"repo":{"id":26379388,"name":"meanjs-template","full_name":"CognitiveScale/meanjs-template","owner":{"login":"CognitiveScale","id":6210254,"avatar_url":"https://avatars.githubusercontent.com/u/6210254?v=3","gravatar_id":"","url":"https://api.github.com/users/CognitiveScale","html_url":"https://github.com/CognitiveScale","followers_url":"https://api.github.com/users/CognitiveScale/followers","following_url":"https://api.github.com/users/CognitiveScale/following{/other_user}","gists_url":"https://api.github.com/users/CognitiveScale/gists{/gist_id}","starred_url":"https://api.github.com/users/CognitiveScale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CognitiveScale/subscriptions","organizations_url":"https://api.github.com/users/CognitiveScale/orgs","repos_url":"https://api.github.com/users/CognitiveScale/repos","events_url":"https://api.github.com/users/CognitiveScale/events{/privacy}","received_events_url":"https://api.github.com/users/CognitiveScale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CognitiveScale/meanjs-template","description":"A template project for a MEAN.JS style web application","fork":false,"url":"https://api.github.com/repos/CognitiveScale/meanjs-template","forks_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/forks","keys_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/teams","hooks_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/hooks","issue_events_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues/events{/number}","events_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/events","assignees_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/assignees{/user}","branches_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/branches{/branch}","tags_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/tags","blobs_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/refs{/sha}","trees_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/statuses/{sha}","languages_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/languages","stargazers_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/stargazers","contributors_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/contributors","subscribers_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/subscribers","subscription_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/subscription","commits_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/commits{/sha}","git_commits_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/git/commits{/sha}","comments_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/comments{/number}","issue_comment_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues/comments{/number}","contents_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/contents/{+path}","compare_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/merges","archive_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/downloads","issues_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues{/number}","pulls_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls{/number}","milestones_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/milestones{/number}","notifications_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/labels{/name}","releases_url":"https://api.github.com/repos/CognitiveScale/meanjs-template/releases{/id}","created_at":"2014-11-09T00:20:16Z","updated_at":"2015-07-13T19:30:51Z","pushed_at":"2015-07-14T15:20:11Z","git_url":"git://github.com/CognitiveScale/meanjs-template.git","ssh_url":"git@github.com:CognitiveScale/meanjs-template.git","clone_url":"https://github.com/CognitiveScale/meanjs-template.git","svn_url":"https://github.com/CognitiveScale/meanjs-template","homepage":null,"size":288,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/4"},"html":{"href":"https://github.com/CognitiveScale/meanjs-template/pull/4"},"issue":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues/4"},"comments":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/CognitiveScale/meanjs-template/statuses/b073a6cef7b5146ad7797f82a4d18fdeca85962d"}}}}