{"action":"closed","number":4,"pull_request":{"url":"https://api.github.com/repos/USGS-EROS/espa-api/pulls/4","id":58184727,"html_url":"https://github.com/USGS-EROS/espa-api/pull/4","diff_url":"https://github.com/USGS-EROS/espa-api/pull/4.diff","patch_url":"https://github.com/USGS-EROS/espa-api/pull/4.patch","issue_url":"https://api.github.com/repos/USGS-EROS/espa-api/issues/4","number":4,"state":"closed","locked":false,"title":"api exception handling proposal","user":{"login":"caustin-usgs","id":16307176,"avatar_url":"https://avatars.githubusercontent.com/u/16307176?v=3","gravatar_id":"","url":"https://api.github.com/users/caustin-usgs","html_url":"https://github.com/caustin-usgs","followers_url":"https://api.github.com/users/caustin-usgs/followers","following_url":"https://api.github.com/users/caustin-usgs/following{/other_user}","gists_url":"https://api.github.com/users/caustin-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/caustin-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caustin-usgs/subscriptions","organizations_url":"https://api.github.com/users/caustin-usgs/orgs","repos_url":"https://api.github.com/users/caustin-usgs/repos","events_url":"https://api.github.com/users/caustin-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/caustin-usgs/received_events","type":"User","site_admin":false},"body":"@davidvhill @klsmith-usgs   here's my proposal for tracking and managing exceptions in the api.\r\n\r\nheres my thought process:\r\n - exceptions with the transport layer should only be related to server and transport activities. these will be captured in the log setup by the uwsgi server running the transport(flask) app. this is why I didn't include any try/except blocks in transport.py\r\n - the api should always return an object that can be converted to JSON, even when theres an issue further down the stack. when there's a problem now the response is a dict of {\"msg\": \"sorry theres been a problem, admins have been notified\"}.  exception details are written to a log.\r\n - we'll need to construct a listener for the error log, so that we're notified when errors are reported.\r\n\r\nI think the logging objects need more thought, but wanted to get this in your faces for review","created_at":"2016-02-03T19:07:08Z","updated_at":"2016-02-04T21:26:27Z","closed_at":"2016-02-04T21:26:27Z","merged_at":"2016-02-04T21:26:27Z","merge_commit_sha":"080f9337e2f3f2366102680b2884358831f32e1a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/USGS-EROS/espa-api/pulls/4/commits","review_comments_url":"https://api.github.com/repos/USGS-EROS/espa-api/pulls/4/comments","review_comment_url":"https://api.github.com/repos/USGS-EROS/espa-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/USGS-EROS/espa-api/issues/4/comments","statuses_url":"https://api.github.com/repos/USGS-EROS/espa-api/statuses/645cf196c79281154aa9db6333a27f742a74ffd7","head":{"label":"USGS-EROS:version0_development_cgaustin","ref":"version0_development_cgaustin","sha":"645cf196c79281154aa9db6333a27f742a74ffd7","user":{"login":"USGS-EROS","id":12549192,"avatar_url":"https://avatars.githubusercontent.com/u/12549192?v=3","gravatar_id":"","url":"https://api.github.com/users/USGS-EROS","html_url":"https://github.com/USGS-EROS","followers_url":"https://api.github.com/users/USGS-EROS/followers","following_url":"https://api.github.com/users/USGS-EROS/following{/other_user}","gists_url":"https://api.github.com/users/USGS-EROS/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-EROS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-EROS/subscriptions","organizations_url":"https://api.github.com/users/USGS-EROS/orgs","repos_url":"https://api.github.com/users/USGS-EROS/repos","events_url":"https://api.github.com/users/USGS-EROS/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-EROS/received_events","type":"Organization","site_admin":false},"repo":{"id":43765055,"name":"espa-api","full_name":"USGS-EROS/espa-api","owner":{"login":"USGS-EROS","id":12549192,"avatar_url":"https://avatars.githubusercontent.com/u/12549192?v=3","gravatar_id":"","url":"https://api.github.com/users/USGS-EROS","html_url":"https://github.com/USGS-EROS","followers_url":"https://api.github.com/users/USGS-EROS/followers","following_url":"https://api.github.com/users/USGS-EROS/following{/other_user}","gists_url":"https://api.github.com/users/USGS-EROS/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-EROS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-EROS/subscriptions","organizations_url":"https://api.github.com/users/USGS-EROS/orgs","repos_url":"https://api.github.com/users/USGS-EROS/repos","events_url":"https://api.github.com/users/USGS-EROS/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-EROS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/USGS-EROS/espa-api","description":"Demo API for the ESPA ordering system.","fork":false,"url":"https://api.github.com/repos/USGS-EROS/espa-api","forks_url":"https://api.github.com/repos/USGS-EROS/espa-api/forks","keys_url":"https://api.github.com/repos/USGS-EROS/espa-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/USGS-EROS/espa-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/USGS-EROS/espa-api/teams","hooks_url":"https://api.github.com/repos/USGS-EROS/espa-api/hooks","issue_events_url":"https://api.github.com/repos/USGS-EROS/espa-api/issues/events{/number}","events_url":"https://api.github.com/repos/USGS-EROS/espa-api/events","assignees_url":"https://api.github.com/repos/USGS-EROS/espa-api/assignees{/user}","branches_url":"https://api.github.com/repos/USGS-EROS/espa-api/branches{/branch}","tags_url":"https://api.github.com/repos/USGS-EROS/espa-api/tags","blobs_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/USGS-EROS/espa-api/statuses/{sha}","languages_url":"https://api.github.com/repos/USGS-EROS/espa-api/languages","stargazers_url":"https://api.github.com/repos/USGS-EROS/espa-api/stargazers","contributors_url":"https://api.github.com/repos/USGS-EROS/espa-api/contributors","subscribers_url":"https://api.github.com/repos/USGS-EROS/espa-api/subscribers","subscription_url":"https://api.github.com/repos/USGS-EROS/espa-api/subscription","commits_url":"https://api.github.com/repos/USGS-EROS/espa-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/USGS-EROS/espa-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/USGS-EROS/espa-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/USGS-EROS/espa-api/contents/{+path}","compare_url":"https://api.github.com/repos/USGS-EROS/espa-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/USGS-EROS/espa-api/merges","archive_url":"https://api.github.com/repos/USGS-EROS/espa-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/USGS-EROS/espa-api/downloads","issues_url":"https://api.github.com/repos/USGS-EROS/espa-api/issues{/number}","pulls_url":"https://api.github.com/repos/USGS-EROS/espa-api/pulls{/number}","milestones_url":"https://api.github.com/repos/USGS-EROS/espa-api/milestones{/number}","notifications_url":"https://api.github.com/repos/USGS-EROS/espa-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/USGS-EROS/espa-api/labels{/name}","releases_url":"https://api.github.com/repos/USGS-EROS/espa-api/releases{/id}","deployments_url":"https://api.github.com/repos/USGS-EROS/espa-api/deployments","created_at":"2015-10-06T17:04:20Z","updated_at":"2016-01-28T19:03:05Z","pushed_at":"2016-02-04T21:26:27Z","git_url":"git://github.com/USGS-EROS/espa-api.git","ssh_url":"git@github.com:USGS-EROS/espa-api.git","clone_url":"https://github.com/USGS-EROS/espa-api.git","svn_url":"https://github.com/USGS-EROS/espa-api","homepage":null,"size":579,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"USGS-EROS:version0_development","ref":"version0_development","sha":"e78f32147e29ce778a693001d102f97c2e62c2cb","user":{"login":"USGS-EROS","id":12549192,"avatar_url":"https://avatars.githubusercontent.com/u/12549192?v=3","gravatar_id":"","url":"https://api.github.com/users/USGS-EROS","html_url":"https://github.com/USGS-EROS","followers_url":"https://api.github.com/users/USGS-EROS/followers","following_url":"https://api.github.com/users/USGS-EROS/following{/other_user}","gists_url":"https://api.github.com/users/USGS-EROS/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-EROS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-EROS/subscriptions","organizations_url":"https://api.github.com/users/USGS-EROS/orgs","repos_url":"https://api.github.com/users/USGS-EROS/repos","events_url":"https://api.github.com/users/USGS-EROS/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-EROS/received_events","type":"Organization","site_admin":false},"repo":{"id":43765055,"name":"espa-api","full_name":"USGS-EROS/espa-api","owner":{"login":"USGS-EROS","id":12549192,"avatar_url":"https://avatars.githubusercontent.com/u/12549192?v=3","gravatar_id":"","url":"https://api.github.com/users/USGS-EROS","html_url":"https://github.com/USGS-EROS","followers_url":"https://api.github.com/users/USGS-EROS/followers","following_url":"https://api.github.com/users/USGS-EROS/following{/other_user}","gists_url":"https://api.github.com/users/USGS-EROS/gists{/gist_id}","starred_url":"https://api.github.com/users/USGS-EROS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/USGS-EROS/subscriptions","organizations_url":"https://api.github.com/users/USGS-EROS/orgs","repos_url":"https://api.github.com/users/USGS-EROS/repos","events_url":"https://api.github.com/users/USGS-EROS/events{/privacy}","received_events_url":"https://api.github.com/users/USGS-EROS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/USGS-EROS/espa-api","description":"Demo API for the ESPA ordering system.","fork":false,"url":"https://api.github.com/repos/USGS-EROS/espa-api","forks_url":"https://api.github.com/repos/USGS-EROS/espa-api/forks","keys_url":"https://api.github.com/repos/USGS-EROS/espa-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/USGS-EROS/espa-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/USGS-EROS/espa-api/teams","hooks_url":"https://api.github.com/repos/USGS-EROS/espa-api/hooks","issue_events_url":"https://api.github.com/repos/USGS-EROS/espa-api/issues/events{/number}","events_url":"https://api.github.com/repos/USGS-EROS/espa-api/events","assignees_url":"https://api.github.com/repos/USGS-EROS/espa-api/assignees{/user}","branches_url":"https://api.github.com/repos/USGS-EROS/espa-api/branches{/branch}","tags_url":"https://api.github.com/repos/USGS-EROS/espa-api/tags","blobs_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/USGS-EROS/espa-api/statuses/{sha}","languages_url":"https://api.github.com/repos/USGS-EROS/espa-api/languages","stargazers_url":"https://api.github.com/repos/USGS-EROS/espa-api/stargazers","contributors_url":"https://api.github.com/repos/USGS-EROS/espa-api/contributors","subscribers_url":"https://api.github.com/repos/USGS-EROS/espa-api/subscribers","subscription_url":"https://api.github.com/repos/USGS-EROS/espa-api/subscription","commits_url":"https://api.github.com/repos/USGS-EROS/espa-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/USGS-EROS/espa-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/USGS-EROS/espa-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/USGS-EROS/espa-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/USGS-EROS/espa-api/contents/{+path}","compare_url":"https://api.github.com/repos/USGS-EROS/espa-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/USGS-EROS/espa-api/merges","archive_url":"https://api.github.com/repos/USGS-EROS/espa-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/USGS-EROS/espa-api/downloads","issues_url":"https://api.github.com/repos/USGS-EROS/espa-api/issues{/number}","pulls_url":"https://api.github.com/repos/USGS-EROS/espa-api/pulls{/number}","milestones_url":"https://api.github.com/repos/USGS-EROS/espa-api/milestones{/number}","notifications_url":"https://api.github.com/repos/USGS-EROS/espa-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/USGS-EROS/espa-api/labels{/name}","releases_url":"https://api.github.com/repos/USGS-EROS/espa-api/releases{/id}","deployments_url":"https://api.github.com/repos/USGS-EROS/espa-api/deployments","created_at":"2015-10-06T17:04:20Z","updated_at":"2016-01-28T19:03:05Z","pushed_at":"2016-02-04T21:26:27Z","git_url":"git://github.com/USGS-EROS/espa-api.git","ssh_url":"git@github.com:USGS-EROS/espa-api.git","clone_url":"https://github.com/USGS-EROS/espa-api.git","svn_url":"https://github.com/USGS-EROS/espa-api","homepage":null,"size":579,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/USGS-EROS/espa-api/pulls/4"},"html":{"href":"https://github.com/USGS-EROS/espa-api/pull/4"},"issue":{"href":"https://api.github.com/repos/USGS-EROS/espa-api/issues/4"},"comments":{"href":"https://api.github.com/repos/USGS-EROS/espa-api/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/USGS-EROS/espa-api/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/USGS-EROS/espa-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/USGS-EROS/espa-api/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/USGS-EROS/espa-api/statuses/645cf196c79281154aa9db6333a27f742a74ffd7"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"caustin-usgs","id":16307176,"avatar_url":"https://avatars.githubusercontent.com/u/16307176?v=3","gravatar_id":"","url":"https://api.github.com/users/caustin-usgs","html_url":"https://github.com/caustin-usgs","followers_url":"https://api.github.com/users/caustin-usgs/followers","following_url":"https://api.github.com/users/caustin-usgs/following{/other_user}","gists_url":"https://api.github.com/users/caustin-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/caustin-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caustin-usgs/subscriptions","organizations_url":"https://api.github.com/users/caustin-usgs/orgs","repos_url":"https://api.github.com/users/caustin-usgs/repos","events_url":"https://api.github.com/users/caustin-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/caustin-usgs/received_events","type":"User","site_admin":false},"comments":0,"review_comments":3,"commits":5,"additions":164,"deletions":42,"changed_files":7}}