{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-app-ios/pulls/comments/49604775","id":49604775,"diff_hunk":"@@ -0,0 +1,34 @@\n+//\n+//  NSError+JSON.swift\n+//  edX\n+//\n+//  Created by Michael Katz on 1/12/16.\n+//  Copyright © 2016 edX. All rights reserved.\n+//\n+\n+import Foundation\n+\n+enum APIErrorCode : String {\n+    case OAuth2Error = \"token_error\"\n+    case OAuth2Expired = \"token_expired\"\n+    case OAuth2Malformed = \"token_malformed\"\n+    case OAuth2Nonexistent = \"token_nonexistent\"\n+    case OAuth2NotProvided = \"token_not_provided\"\n+}\n+\n+private enum ErrorFields: String, RawStringExtractable {\n+    case Code = \"error_code\"\n+    case DeveloperMessage = \"developer_message\"\n+}\n+\n+extension NSError {\n+    convenience init?(json: JSON, code: Int) {","path":"Source/NSError+JSON.swift","position":25,"original_position":25,"commit_id":"d2abd6e3ac817622a67161391a72fd84ec10efd4","original_commit_id":"d2abd6e3ac817622a67161391a72fd84ec10efd4","user":{"login":"mikekatz","id":1330884,"avatar_url":"https://avatars.githubusercontent.com/u/1330884?v=3","gravatar_id":"","url":"https://api.github.com/users/mikekatz","html_url":"https://github.com/mikekatz","followers_url":"https://api.github.com/users/mikekatz/followers","following_url":"https://api.github.com/users/mikekatz/following{/other_user}","gists_url":"https://api.github.com/users/mikekatz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikekatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikekatz/subscriptions","organizations_url":"https://api.github.com/users/mikekatz/orgs","repos_url":"https://api.github.com/users/mikekatz/repos","events_url":"https://api.github.com/users/mikekatz/events{/privacy}","received_events_url":"https://api.github.com/users/mikekatz/received_events","type":"User","site_admin":false},"body":"yes, it is. The code passed in is for the error code. ","created_at":"2016-01-13T15:34:38Z","updated_at":"2016-01-13T15:34:38Z","html_url":"https://github.com/edx/edx-app-ios/pull/639#discussion_r49604775","pull_request_url":"https://api.github.com/repos/edx/edx-app-ios/pulls/639","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-app-ios/pulls/comments/49604775"},"html":{"href":"https://github.com/edx/edx-app-ios/pull/639#discussion_r49604775"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-app-ios/pulls/639"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-app-ios/pulls/639","id":55801511,"html_url":"https://github.com/edx/edx-app-ios/pull/639","diff_url":"https://github.com/edx/edx-app-ios/pull/639.diff","patch_url":"https://github.com/edx/edx-app-ios/pull/639.patch","issue_url":"https://api.github.com/repos/edx/edx-app-ios/issues/639","number":639,"state":"open","locked":false,"title":"add logout for token expiry MA-1771","user":{"login":"mikekatz","id":1330884,"avatar_url":"https://avatars.githubusercontent.com/u/1330884?v=3","gravatar_id":"","url":"https://api.github.com/users/mikekatz","html_url":"https://github.com/mikekatz","followers_url":"https://api.github.com/users/mikekatz/followers","following_url":"https://api.github.com/users/mikekatz/following{/other_user}","gists_url":"https://api.github.com/users/mikekatz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikekatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikekatz/subscriptions","organizations_url":"https://api.github.com/users/mikekatz/orgs","repos_url":"https://api.github.com/users/mikekatz/repos","events_url":"https://api.github.com/users/mikekatz/events{/privacy}","received_events_url":"https://api.github.com/users/mikekatz/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-12T19:02:10Z","updated_at":"2016-01-13T15:34:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df27401e8784446fbf4f8b26d0ebcd680196c826","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-app-ios/pulls/639/commits","review_comments_url":"https://api.github.com/repos/edx/edx-app-ios/pulls/639/comments","review_comment_url":"https://api.github.com/repos/edx/edx-app-ios/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-app-ios/issues/639/comments","statuses_url":"https://api.github.com/repos/edx/edx-app-ios/statuses/d2abd6e3ac817622a67161391a72fd84ec10efd4","head":{"label":"edx:mkatz/oauth","ref":"mkatz/oauth","sha":"d2abd6e3ac817622a67161391a72fd84ec10efd4","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":29251733,"name":"edx-app-ios","full_name":"edx/edx-app-ios","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-app-ios","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-app-ios","forks_url":"https://api.github.com/repos/edx/edx-app-ios/forks","keys_url":"https://api.github.com/repos/edx/edx-app-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-app-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-app-ios/teams","hooks_url":"https://api.github.com/repos/edx/edx-app-ios/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-app-ios/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-app-ios/events","assignees_url":"https://api.github.com/repos/edx/edx-app-ios/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-app-ios/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-app-ios/tags","blobs_url":"https://api.github.com/repos/edx/edx-app-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-app-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-app-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-app-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-app-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-app-ios/languages","stargazers_url":"https://api.github.com/repos/edx/edx-app-ios/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-app-ios/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-app-ios/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-app-ios/subscription","commits_url":"https://api.github.com/repos/edx/edx-app-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-app-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-app-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-app-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-app-ios/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-app-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-app-ios/merges","archive_url":"https://api.github.com/repos/edx/edx-app-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-app-ios/downloads","issues_url":"https://api.github.com/repos/edx/edx-app-ios/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-app-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-app-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-app-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-app-ios/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-app-ios/releases{/id}","created_at":"2015-01-14T15:49:29Z","updated_at":"2016-01-11T19:03:24Z","pushed_at":"2016-01-13T12:11:20Z","git_url":"git://github.com/edx/edx-app-ios.git","ssh_url":"git@github.com:edx/edx-app-ios.git","clone_url":"https://github.com/edx/edx-app-ios.git","svn_url":"https://github.com/edx/edx-app-ios","homepage":null,"size":304808,"stargazers_count":42,"watchers_count":42,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":9,"forks":57,"open_issues":9,"watchers":42,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"c982f2499fa3925f834322e61e1eb4cf6cd361ed","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":29251733,"name":"edx-app-ios","full_name":"edx/edx-app-ios","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-app-ios","description":"","fork":false,"url":"https://api.github.com/repos/edx/edx-app-ios","forks_url":"https://api.github.com/repos/edx/edx-app-ios/forks","keys_url":"https://api.github.com/repos/edx/edx-app-ios/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-app-ios/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-app-ios/teams","hooks_url":"https://api.github.com/repos/edx/edx-app-ios/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-app-ios/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-app-ios/events","assignees_url":"https://api.github.com/repos/edx/edx-app-ios/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-app-ios/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-app-ios/tags","blobs_url":"https://api.github.com/repos/edx/edx-app-ios/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-app-ios/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-app-ios/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-app-ios/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-app-ios/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-app-ios/languages","stargazers_url":"https://api.github.com/repos/edx/edx-app-ios/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-app-ios/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-app-ios/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-app-ios/subscription","commits_url":"https://api.github.com/repos/edx/edx-app-ios/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-app-ios/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-app-ios/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-app-ios/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-app-ios/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-app-ios/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-app-ios/merges","archive_url":"https://api.github.com/repos/edx/edx-app-ios/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-app-ios/downloads","issues_url":"https://api.github.com/repos/edx/edx-app-ios/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-app-ios/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-app-ios/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-app-ios/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-app-ios/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-app-ios/releases{/id}","created_at":"2015-01-14T15:49:29Z","updated_at":"2016-01-11T19:03:24Z","pushed_at":"2016-01-13T12:11:20Z","git_url":"git://github.com/edx/edx-app-ios.git","ssh_url":"git@github.com:edx/edx-app-ios.git","clone_url":"https://github.com/edx/edx-app-ios.git","svn_url":"https://github.com/edx/edx-app-ios","homepage":null,"size":304808,"stargazers_count":42,"watchers_count":42,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":9,"forks":57,"open_issues":9,"watchers":42,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-app-ios/pulls/639"},"html":{"href":"https://github.com/edx/edx-app-ios/pull/639"},"issue":{"href":"https://api.github.com/repos/edx/edx-app-ios/issues/639"},"comments":{"href":"https://api.github.com/repos/edx/edx-app-ios/issues/639/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-app-ios/pulls/639/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-app-ios/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-app-ios/pulls/639/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-app-ios/statuses/d2abd6e3ac817622a67161391a72fd84ec10efd4"}}}}