{"action":"created","comment":{"url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/comments/80250301","id":80250301,"diff_hunk":"@@ -4,51 +4,96 @@\n \n import Foundation\n \n-/// The `Error` struct provides a convenience for creating custom Commercetools SDK NSErrors.\n-public struct CTError {\n-\n-    /// The domain used for creating all Commercetools errors.\n-    public static let Domain = \"com.commercetools.error\"\n-\n-    /// The custom error codes generated by Commercetools.\n-    public enum Code: Int {\n-        case configurationValidationFailed       = -7000\n-        case accessTokenRetrievalFailed          = -7001\n-        case invalidJsonInputError               = -7002\n-        case resourceNotFoundError               = -7003\n-        case concurrentModificationError         = -7004\n-        case insufficientTokenGrantTypeError     = -7005\n-        case generalCommercetoolsError           = -7099\n-\n-        init(code: String) {\n-            switch code {\n-            case \"ConfigurationValidationFailed\":\n-                self = .configurationValidationFailed\n-            case \"AccessTokenRetrievalFailed\":\n-                self = .accessTokenRetrievalFailed\n-            case \"InvalidJsonInput\":\n-                self = .invalidJsonInputError\n-            case \"ResourceNotFound\":\n-                self = .resourceNotFoundError\n-            case \"ConcurrentModification\":\n-                self = .concurrentModificationError\n-            case \"insufficient_token_grant_type\":\n-                self = .insufficientTokenGrantTypeError\n-            default:\n-                self = .generalCommercetoolsError\n-            }\n+/// `CTError` is the error type returned by Commercetools SDK. It includes a few different error cases, each with\n+/// descriptive failure reason.\n+///\n+/// - configurationValidationFailed:    Returned if the Commercetools SDK configuration hasn't been properly set.\n+/// - accessTokenRetrievalFailed:       Returned when there is an issue obtaining access token.\n+/// - invalidJsonInputError:            Returned in case of badly formed request.\n+/// - resourceNotFoundError:            Returned when a requested object was not found.\n+/// - concurrentModificationError:      Returned in a case when the incorrect version is passed to either `create` or `update` method.","path":"Source/CTError.swift","position":44,"original_position":44,"commit_id":"839b263dcb0c33a1a1c83652b931c5f06daad60a","original_commit_id":"839b263dcb0c33a1a1c83652b931c5f06daad60a","user":{"login":"cneijenhuis","id":2638512,"avatar_url":"https://avatars.githubusercontent.com/u/2638512?v=3","gravatar_id":"","url":"https://api.github.com/users/cneijenhuis","html_url":"https://github.com/cneijenhuis","followers_url":"https://api.github.com/users/cneijenhuis/followers","following_url":"https://api.github.com/users/cneijenhuis/following{/other_user}","gists_url":"https://api.github.com/users/cneijenhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/cneijenhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cneijenhuis/subscriptions","organizations_url":"https://api.github.com/users/cneijenhuis/orgs","repos_url":"https://api.github.com/users/cneijenhuis/repos","events_url":"https://api.github.com/users/cneijenhuis/events{/privacy}","received_events_url":"https://api.github.com/users/cneijenhuis/received_events","type":"User","site_admin":false},"body":"`...in case...`\r\n\r\nIs also returned on `delete` with incorrect version.","created_at":"2016-09-23T14:01:29Z","updated_at":"2016-09-23T14:06:13Z","html_url":"https://github.com/sphereio/commercetools-ios-sdk/pull/76#discussion_r80250301","pull_request_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/comments/80250301"},"html":{"href":"https://github.com/sphereio/commercetools-ios-sdk/pull/76#discussion_r80250301"},"pull_request":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/76","id":86512655,"html_url":"https://github.com/sphereio/commercetools-ios-sdk/pull/76","diff_url":"https://github.com/sphereio/commercetools-ios-sdk/pull/76.diff","patch_url":"https://github.com/sphereio/commercetools-ios-sdk/pull/76.patch","issue_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues/76","number":76,"state":"open","locked":false,"title":"Closes #71 Refactor CTError to be more aligned with new 4.0 AFError structure","user":{"login":"nikola-mladenovic","id":14024032,"avatar_url":"https://avatars.githubusercontent.com/u/14024032?v=3","gravatar_id":"","url":"https://api.github.com/users/nikola-mladenovic","html_url":"https://github.com/nikola-mladenovic","followers_url":"https://api.github.com/users/nikola-mladenovic/followers","following_url":"https://api.github.com/users/nikola-mladenovic/following{/other_user}","gists_url":"https://api.github.com/users/nikola-mladenovic/gists{/gist_id}","starred_url":"https://api.github.com/users/nikola-mladenovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikola-mladenovic/subscriptions","organizations_url":"https://api.github.com/users/nikola-mladenovic/orgs","repos_url":"https://api.github.com/users/nikola-mladenovic/repos","events_url":"https://api.github.com/users/nikola-mladenovic/events{/privacy}","received_events_url":"https://api.github.com/users/nikola-mladenovic/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-23T13:28:39Z","updated_at":"2016-09-23T14:06:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90bf0f9315d126d6562f878e38d6913307e2557e","assignee":{"login":"lauraluiz","id":1917621,"avatar_url":"https://avatars.githubusercontent.com/u/1917621?v=3","gravatar_id":"","url":"https://api.github.com/users/lauraluiz","html_url":"https://github.com/lauraluiz","followers_url":"https://api.github.com/users/lauraluiz/followers","following_url":"https://api.github.com/users/lauraluiz/following{/other_user}","gists_url":"https://api.github.com/users/lauraluiz/gists{/gist_id}","starred_url":"https://api.github.com/users/lauraluiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauraluiz/subscriptions","organizations_url":"https://api.github.com/users/lauraluiz/orgs","repos_url":"https://api.github.com/users/lauraluiz/repos","events_url":"https://api.github.com/users/lauraluiz/events{/privacy}","received_events_url":"https://api.github.com/users/lauraluiz/received_events","type":"User","site_admin":false},"assignees":[{"login":"lauraluiz","id":1917621,"avatar_url":"https://avatars.githubusercontent.com/u/1917621?v=3","gravatar_id":"","url":"https://api.github.com/users/lauraluiz","html_url":"https://github.com/lauraluiz","followers_url":"https://api.github.com/users/lauraluiz/followers","following_url":"https://api.github.com/users/lauraluiz/following{/other_user}","gists_url":"https://api.github.com/users/lauraluiz/gists{/gist_id}","starred_url":"https://api.github.com/users/lauraluiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lauraluiz/subscriptions","organizations_url":"https://api.github.com/users/lauraluiz/orgs","repos_url":"https://api.github.com/users/lauraluiz/repos","events_url":"https://api.github.com/users/lauraluiz/events{/privacy}","received_events_url":"https://api.github.com/users/lauraluiz/received_events","type":"User","site_admin":false},{"login":"cneijenhuis","id":2638512,"avatar_url":"https://avatars.githubusercontent.com/u/2638512?v=3","gravatar_id":"","url":"https://api.github.com/users/cneijenhuis","html_url":"https://github.com/cneijenhuis","followers_url":"https://api.github.com/users/cneijenhuis/followers","following_url":"https://api.github.com/users/cneijenhuis/following{/other_user}","gists_url":"https://api.github.com/users/cneijenhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/cneijenhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cneijenhuis/subscriptions","organizations_url":"https://api.github.com/users/cneijenhuis/orgs","repos_url":"https://api.github.com/users/cneijenhuis/repos","events_url":"https://api.github.com/users/cneijenhuis/events{/privacy}","received_events_url":"https://api.github.com/users/cneijenhuis/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/76/commits","review_comments_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/76/comments","review_comment_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues/76/comments","statuses_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/statuses/839b263dcb0c33a1a1c83652b931c5f06daad60a","head":{"label":"sphereio:issues/#71-swift-3","ref":"issues/#71-swift-3","sha":"839b263dcb0c33a1a1c83652b931c5f06daad60a","user":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"repo":{"id":55976787,"name":"commercetools-ios-sdk","full_name":"sphereio/commercetools-ios-sdk","owner":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphereio/commercetools-ios-sdk","description":"The e-commerce iOS SDK from commercetools.","fork":false,"url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk","forks_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/forks","keys_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/teams","hooks_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/hooks","issue_events_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/events","assignees_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/tags","blobs_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/languages","stargazers_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/stargazers","contributors_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/contributors","subscribers_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/subscribers","subscription_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/subscription","commits_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/merges","archive_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/downloads","issues_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/labels{/name}","releases_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/deployments","created_at":"2016-04-11T13:57:03Z","updated_at":"2016-06-08T08:15:57Z","pushed_at":"2016-09-23T13:28:39Z","git_url":"git://github.com/sphereio/commercetools-ios-sdk.git","ssh_url":"git@github.com:sphereio/commercetools-ios-sdk.git","clone_url":"https://github.com/sphereio/commercetools-ios-sdk.git","svn_url":"https://github.com/sphereio/commercetools-ios-sdk","homepage":"","size":154,"stargazers_count":5,"watchers_count":5,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":5,"default_branch":"master"}},"base":{"label":"sphereio:master","ref":"master","sha":"6499287bcee2ba4f290b4a2a9355cb67c9e65f0c","user":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"repo":{"id":55976787,"name":"commercetools-ios-sdk","full_name":"sphereio/commercetools-ios-sdk","owner":{"login":"sphereio","id":4119130,"avatar_url":"https://avatars.githubusercontent.com/u/4119130?v=3","gravatar_id":"","url":"https://api.github.com/users/sphereio","html_url":"https://github.com/sphereio","followers_url":"https://api.github.com/users/sphereio/followers","following_url":"https://api.github.com/users/sphereio/following{/other_user}","gists_url":"https://api.github.com/users/sphereio/gists{/gist_id}","starred_url":"https://api.github.com/users/sphereio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sphereio/subscriptions","organizations_url":"https://api.github.com/users/sphereio/orgs","repos_url":"https://api.github.com/users/sphereio/repos","events_url":"https://api.github.com/users/sphereio/events{/privacy}","received_events_url":"https://api.github.com/users/sphereio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sphereio/commercetools-ios-sdk","description":"The e-commerce iOS SDK from commercetools.","fork":false,"url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk","forks_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/forks","keys_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/teams","hooks_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/hooks","issue_events_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/events","assignees_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/tags","blobs_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/languages","stargazers_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/stargazers","contributors_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/contributors","subscribers_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/subscribers","subscription_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/subscription","commits_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/merges","archive_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/downloads","issues_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/labels{/name}","releases_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/deployments","created_at":"2016-04-11T13:57:03Z","updated_at":"2016-06-08T08:15:57Z","pushed_at":"2016-09-23T13:28:39Z","git_url":"git://github.com/sphereio/commercetools-ios-sdk.git","ssh_url":"git@github.com:sphereio/commercetools-ios-sdk.git","clone_url":"https://github.com/sphereio/commercetools-ios-sdk.git","svn_url":"https://github.com/sphereio/commercetools-ios-sdk","homepage":"","size":154,"stargazers_count":5,"watchers_count":5,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/76"},"html":{"href":"https://github.com/sphereio/commercetools-ios-sdk/pull/76"},"issue":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues/76"},"comments":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/sphereio/commercetools-ios-sdk/statuses/839b263dcb0c33a1a1c83652b931c5f06daad60a"}}}}
{"actor":{"display_login":"cneijenhuis"}}