{"action":"opened","number":1456,"pull_request":{"url":"https://api.github.com/repos/transcom/mymove/pulls/1456","id":238238550,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MjM4NTUw","html_url":"https://github.com/transcom/mymove/pull/1456","diff_url":"https://github.com/transcom/mymove/pull/1456.diff","patch_url":"https://github.com/transcom/mymove/pull/1456.patch","issue_url":"https://api.github.com/repos/transcom/mymove/issues/1456","number":1456,"state":"open","locked":false,"title":"Created new Go error for unsupported postal codes","user":{"login":"reggieriser","id":4960757,"node_id":"MDQ6VXNlcjQ5NjA3NTc=","avatar_url":"https://avatars0.githubusercontent.com/u/4960757?v=4","gravatar_id":"","url":"https://api.github.com/users/reggieriser","html_url":"https://github.com/reggieriser","followers_url":"https://api.github.com/users/reggieriser/followers","following_url":"https://api.github.com/users/reggieriser/following{/other_user}","gists_url":"https://api.github.com/users/reggieriser/gists{/gist_id}","starred_url":"https://api.github.com/users/reggieriser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reggieriser/subscriptions","organizations_url":"https://api.github.com/users/reggieriser/orgs","repos_url":"https://api.github.com/users/reggieriser/repos","events_url":"https://api.github.com/users/reggieriser/events{/privacy}","received_events_url":"https://api.github.com/users/reggieriser/received_events","type":"User","site_admin":false},"body":"## Description\r\n\r\nThis PR adds in a new custom Go error for unsupported postal codes.  It also ensures that our handlers return a status code of 422 (StatusUnprocessableEntity) in that situation.  Previously, these were being returned as a status code of 500 (StatusInternalServerError), which caused them to show up as alerts.\r\n\r\n## Reviewer Notes\r\n\r\nNote that I needed to create a custom error type (unlike some of the other ones we single out in `handlers/errors.go`) because I wanted to preserve the specific unsupported postal code in the error (the other types like `ErrFetchNotFound` aren't custom errors, but just constants that are the same for all errors of that type.\r\n\r\nThis PR should be considered a quick first step to clean up our alerts some.  I'm going to be creating a story soon about validating zip codes earlier in the process -- probably on initial submission.\r\n\r\n## Setup\r\n\r\nCreate a PPM move in the system and give it a destination postal code of 93333 (which isn't a legit US postal code).  When you get to the page in the PPM wizard where you pick the size of your shipment, pick a size and hit \"Next\".  You should get an error on the page -- before this PR it was an internal server error, and now it's an unprocessable entity.  You can verify the 422 status code in the dev tools of your browser, as well as the fact the postal code is still noted in the response as before (even though we aren't using a base error type anymore).\r\n\r\n## Code Review Verification Steps\r\n\r\n* [ ] Code follows the guidelines for [Logging](./docs/backend.md#logging)\r\n* [ ] Request review from a member of a different team.\r\n* [ ] Have the Pivotal acceptance criteria been met for this change?\r\n\r\n## References\r\n\r\n* [Pivotal story](https://www.pivotaltracker.com/story/show/162257342) for this change\r\n","created_at":"2018-12-13T01:38:47Z","updated_at":"2018-12-13T01:38:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/transcom/mymove/pulls/1456/commits","review_comments_url":"https://api.github.com/repos/transcom/mymove/pulls/1456/comments","review_comment_url":"https://api.github.com/repos/transcom/mymove/pulls/comments{/number}","comments_url":"https://api.github.com/repos/transcom/mymove/issues/1456/comments","statuses_url":"https://api.github.com/repos/transcom/mymove/statuses/f29499857e34e0f44e498e1ba68f32d8438c4648","head":{"label":"transcom:rr-162257342-dont-return-500-here-cannot","ref":"rr-162257342-dont-return-500-here-cannot","sha":"f29499857e34e0f44e498e1ba68f32d8438c4648","user":{"login":"transcom","id":34352343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MzUyMzQz","avatar_url":"https://avatars0.githubusercontent.com/u/34352343?v=4","gravatar_id":"","url":"https://api.github.com/users/transcom","html_url":"https://github.com/transcom","followers_url":"https://api.github.com/users/transcom/followers","following_url":"https://api.github.com/users/transcom/following{/other_user}","gists_url":"https://api.github.com/users/transcom/gists{/gist_id}","starred_url":"https://api.github.com/users/transcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/transcom/subscriptions","organizations_url":"https://api.github.com/users/transcom/orgs","repos_url":"https://api.github.com/users/transcom/repos","events_url":"https://api.github.com/users/transcom/events{/privacy}","received_events_url":"https://api.github.com/users/transcom/received_events","type":"Organization","site_admin":false},"repo":{"id":114694829,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ2OTQ4Mjk=","name":"mymove","full_name":"transcom/mymove","private":false,"owner":{"login":"transcom","id":34352343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MzUyMzQz","avatar_url":"https://avatars0.githubusercontent.com/u/34352343?v=4","gravatar_id":"","url":"https://api.github.com/users/transcom","html_url":"https://github.com/transcom","followers_url":"https://api.github.com/users/transcom/followers","following_url":"https://api.github.com/users/transcom/following{/other_user}","gists_url":"https://api.github.com/users/transcom/gists{/gist_id}","starred_url":"https://api.github.com/users/transcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/transcom/subscriptions","organizations_url":"https://api.github.com/users/transcom/orgs","repos_url":"https://api.github.com/users/transcom/repos","events_url":"https://api.github.com/users/transcom/events{/privacy}","received_events_url":"https://api.github.com/users/transcom/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/transcom/mymove","description":"MyMove Personal Property Prototype","fork":false,"url":"https://api.github.com/repos/transcom/mymove","forks_url":"https://api.github.com/repos/transcom/mymove/forks","keys_url":"https://api.github.com/repos/transcom/mymove/keys{/key_id}","collaborators_url":"https://api.github.com/repos/transcom/mymove/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/transcom/mymove/teams","hooks_url":"https://api.github.com/repos/transcom/mymove/hooks","issue_events_url":"https://api.github.com/repos/transcom/mymove/issues/events{/number}","events_url":"https://api.github.com/repos/transcom/mymove/events","assignees_url":"https://api.github.com/repos/transcom/mymove/assignees{/user}","branches_url":"https://api.github.com/repos/transcom/mymove/branches{/branch}","tags_url":"https://api.github.com/repos/transcom/mymove/tags","blobs_url":"https://api.github.com/repos/transcom/mymove/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/transcom/mymove/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/transcom/mymove/git/refs{/sha}","trees_url":"https://api.github.com/repos/transcom/mymove/git/trees{/sha}","statuses_url":"https://api.github.com/repos/transcom/mymove/statuses/{sha}","languages_url":"https://api.github.com/repos/transcom/mymove/languages","stargazers_url":"https://api.github.com/repos/transcom/mymove/stargazers","contributors_url":"https://api.github.com/repos/transcom/mymove/contributors","subscribers_url":"https://api.github.com/repos/transcom/mymove/subscribers","subscription_url":"https://api.github.com/repos/transcom/mymove/subscription","commits_url":"https://api.github.com/repos/transcom/mymove/commits{/sha}","git_commits_url":"https://api.github.com/repos/transcom/mymove/git/commits{/sha}","comments_url":"https://api.github.com/repos/transcom/mymove/comments{/number}","issue_comment_url":"https://api.github.com/repos/transcom/mymove/issues/comments{/number}","contents_url":"https://api.github.com/repos/transcom/mymove/contents/{+path}","compare_url":"https://api.github.com/repos/transcom/mymove/compare/{base}...{head}","merges_url":"https://api.github.com/repos/transcom/mymove/merges","archive_url":"https://api.github.com/repos/transcom/mymove/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/transcom/mymove/downloads","issues_url":"https://api.github.com/repos/transcom/mymove/issues{/number}","pulls_url":"https://api.github.com/repos/transcom/mymove/pulls{/number}","milestones_url":"https://api.github.com/repos/transcom/mymove/milestones{/number}","notifications_url":"https://api.github.com/repos/transcom/mymove/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/transcom/mymove/labels{/name}","releases_url":"https://api.github.com/repos/transcom/mymove/releases{/id}","deployments_url":"https://api.github.com/repos/transcom/mymove/deployments","created_at":"2017-12-18T22:41:12Z","updated_at":"2018-12-13T00:29:15Z","pushed_at":"2018-12-13T01:25:48Z","git_url":"git://github.com/transcom/mymove.git","ssh_url":"git@github.com:transcom/mymove.git","clone_url":"https://github.com/transcom/mymove.git","svn_url":"https://github.com/transcom/mymove","homepage":"https://move.mil","size":32076,"stargazers_count":16,"watchers_count":16,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":13,"open_issues":20,"watchers":16,"default_branch":"master"}},"base":{"label":"transcom:master","ref":"master","sha":"60d010203663e460eb5d167fe1049c305213c04f","user":{"login":"transcom","id":34352343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MzUyMzQz","avatar_url":"https://avatars0.githubusercontent.com/u/34352343?v=4","gravatar_id":"","url":"https://api.github.com/users/transcom","html_url":"https://github.com/transcom","followers_url":"https://api.github.com/users/transcom/followers","following_url":"https://api.github.com/users/transcom/following{/other_user}","gists_url":"https://api.github.com/users/transcom/gists{/gist_id}","starred_url":"https://api.github.com/users/transcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/transcom/subscriptions","organizations_url":"https://api.github.com/users/transcom/orgs","repos_url":"https://api.github.com/users/transcom/repos","events_url":"https://api.github.com/users/transcom/events{/privacy}","received_events_url":"https://api.github.com/users/transcom/received_events","type":"Organization","site_admin":false},"repo":{"id":114694829,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ2OTQ4Mjk=","name":"mymove","full_name":"transcom/mymove","private":false,"owner":{"login":"transcom","id":34352343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0MzUyMzQz","avatar_url":"https://avatars0.githubusercontent.com/u/34352343?v=4","gravatar_id":"","url":"https://api.github.com/users/transcom","html_url":"https://github.com/transcom","followers_url":"https://api.github.com/users/transcom/followers","following_url":"https://api.github.com/users/transcom/following{/other_user}","gists_url":"https://api.github.com/users/transcom/gists{/gist_id}","starred_url":"https://api.github.com/users/transcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/transcom/subscriptions","organizations_url":"https://api.github.com/users/transcom/orgs","repos_url":"https://api.github.com/users/transcom/repos","events_url":"https://api.github.com/users/transcom/events{/privacy}","received_events_url":"https://api.github.com/users/transcom/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/transcom/mymove","description":"MyMove Personal Property Prototype","fork":false,"url":"https://api.github.com/repos/transcom/mymove","forks_url":"https://api.github.com/repos/transcom/mymove/forks","keys_url":"https://api.github.com/repos/transcom/mymove/keys{/key_id}","collaborators_url":"https://api.github.com/repos/transcom/mymove/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/transcom/mymove/teams","hooks_url":"https://api.github.com/repos/transcom/mymove/hooks","issue_events_url":"https://api.github.com/repos/transcom/mymove/issues/events{/number}","events_url":"https://api.github.com/repos/transcom/mymove/events","assignees_url":"https://api.github.com/repos/transcom/mymove/assignees{/user}","branches_url":"https://api.github.com/repos/transcom/mymove/branches{/branch}","tags_url":"https://api.github.com/repos/transcom/mymove/tags","blobs_url":"https://api.github.com/repos/transcom/mymove/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/transcom/mymove/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/transcom/mymove/git/refs{/sha}","trees_url":"https://api.github.com/repos/transcom/mymove/git/trees{/sha}","statuses_url":"https://api.github.com/repos/transcom/mymove/statuses/{sha}","languages_url":"https://api.github.com/repos/transcom/mymove/languages","stargazers_url":"https://api.github.com/repos/transcom/mymove/stargazers","contributors_url":"https://api.github.com/repos/transcom/mymove/contributors","subscribers_url":"https://api.github.com/repos/transcom/mymove/subscribers","subscription_url":"https://api.github.com/repos/transcom/mymove/subscription","commits_url":"https://api.github.com/repos/transcom/mymove/commits{/sha}","git_commits_url":"https://api.github.com/repos/transcom/mymove/git/commits{/sha}","comments_url":"https://api.github.com/repos/transcom/mymove/comments{/number}","issue_comment_url":"https://api.github.com/repos/transcom/mymove/issues/comments{/number}","contents_url":"https://api.github.com/repos/transcom/mymove/contents/{+path}","compare_url":"https://api.github.com/repos/transcom/mymove/compare/{base}...{head}","merges_url":"https://api.github.com/repos/transcom/mymove/merges","archive_url":"https://api.github.com/repos/transcom/mymove/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/transcom/mymove/downloads","issues_url":"https://api.github.com/repos/transcom/mymove/issues{/number}","pulls_url":"https://api.github.com/repos/transcom/mymove/pulls{/number}","milestones_url":"https://api.github.com/repos/transcom/mymove/milestones{/number}","notifications_url":"https://api.github.com/repos/transcom/mymove/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/transcom/mymove/labels{/name}","releases_url":"https://api.github.com/repos/transcom/mymove/releases{/id}","deployments_url":"https://api.github.com/repos/transcom/mymove/deployments","created_at":"2017-12-18T22:41:12Z","updated_at":"2018-12-13T00:29:15Z","pushed_at":"2018-12-13T01:25:48Z","git_url":"git://github.com/transcom/mymove.git","ssh_url":"git@github.com:transcom/mymove.git","clone_url":"https://github.com/transcom/mymove.git","svn_url":"https://github.com/transcom/mymove","homepage":"https://move.mil","size":32076,"stargazers_count":16,"watchers_count":16,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":13,"open_issues":20,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/transcom/mymove/pulls/1456"},"html":{"href":"https://github.com/transcom/mymove/pull/1456"},"issue":{"href":"https://api.github.com/repos/transcom/mymove/issues/1456"},"comments":{"href":"https://api.github.com/repos/transcom/mymove/issues/1456/comments"},"review_comments":{"href":"https://api.github.com/repos/transcom/mymove/pulls/1456/comments"},"review_comment":{"href":"https://api.github.com/repos/transcom/mymove/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/transcom/mymove/pulls/1456/commits"},"statuses":{"href":"https://api.github.com/repos/transcom/mymove/statuses/f29499857e34e0f44e498e1ba68f32d8438c4648"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":37,"deletions":2,"changed_files":3}}
{"actor":{"display_login":"reggieriser"}}