{"action":"created","comment":{"url":"https://api.github.com/repos/Alamofire/Alamofire/pulls/comments/76539787","id":76539787,"diff_hunk":"@@ -24,41 +24,540 @@\n \n import Foundation\n \n-/// The domain used for creating all Alamofire errors.\n-public let ErrorDomain = \"org.alamofire.error\"\n-\n-/// The custom error codes generated by Alamofire.\n-public enum ErrorCode: Int {\n-    case inputStreamReadFailed           = -6000\n-    case outputStreamWriteFailed         = -6001\n-    case contentTypeValidationFailed     = -6002\n-    case statusCodeValidationFailed      = -6003\n-    case dataSerializationFailed         = -6004\n-    case stringSerializationFailed       = -6005\n-    case jsonSerializationFailed         = -6006\n-    case propertyListSerializationFailed = -6007\n+/// `AFError` is the error type returned by the Alamofire framework. It encompasses a few\n+/// different types of errors, each with their own associated reasons.\n+///\n+/// `.multipartEncodingFailed` errors are returned when some step in the multipart encoding process fails.\n+///\n+/// `.responseValidationFailed` errors are returned when a `validate()` call fails.\n+///\n+/// `.responseSerializationFailed` errors are returned when a response serializer encounters an error in the serialization process.\n+public enum AFError: Error {\n+\n+    public enum MultipartEncodingFailureReason {\n+        case bodyPartURLInvalid(at: URL)\n+        case bodyPartFilenameInvalid(in: URL)\n+        case bodyPartFileNotReachable(at: URL)\n+        case bodyPartFileNotReachableWithError(url: URL, error: Error)\n+        case bodyPartFileIsDirectory(at: URL)\n+        case bodyPartFileSizeNotAvailable(at: URL)\n+        case bodyPartFileSizeQueryFailedWithError(url: URL, error: Error)\n+        case bodyPartInputStreamCreationFailed(for: URL)\n+\n+        case outputStreamCreationFailed(for: URL)\n+        case outputStreamFileAlreadyExists(at: URL)\n+        case outputStreamURLInvalid(url: URL)\n+        case outputStreamWriteFailed(error: Error)\n+\n+        case inputStreamReadFailed(error: Error)\n+    }\n+\n+    public enum ValidationFailureReason {\n+        case missingContentType(acceptable: [String])\n+        case unacceptableContentType(acceptable: [String], response: String)\n+        case unacceptableStatusCode(code: Int)\n+    }\n+\n+    public enum SerializationFailureReason {\n+        case inputDataNil\n+        case inputDataNilOrZeroLength\n+        case stringSerializationFailed(encoding: String.Encoding)\n+        case jsonSerializationFailed(error: Error)\n+        case propertyListSerializationFailed(error: Error)\n+    }","path":"Source/Error.swift","position":96,"original_position":57,"commit_id":"89c5a5a4959ef2bbad4b00df14a6b17f56916c0f","original_commit_id":"60dc4ec0525ebe034787ada405bdfe3e6d644507","user":{"login":"jshier","id":51020,"avatar_url":"https://avatars.githubusercontent.com/u/51020?v=3","gravatar_id":"","url":"https://api.github.com/users/jshier","html_url":"https://github.com/jshier","followers_url":"https://api.github.com/users/jshier/followers","following_url":"https://api.github.com/users/jshier/following{/other_user}","gists_url":"https://api.github.com/users/jshier/gists{/gist_id}","starred_url":"https://api.github.com/users/jshier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jshier/subscriptions","organizations_url":"https://api.github.com/users/jshier/orgs","repos_url":"https://api.github.com/users/jshier/repos","events_url":"https://api.github.com/users/jshier/events{/privacy}","received_events_url":"https://api.github.com/users/jshier/received_events","type":"User","site_admin":false},"body":"Added all docstrings. ","created_at":"2016-08-28T21:47:06Z","updated_at":"2016-08-28T21:47:06Z","html_url":"https://github.com/Alamofire/Alamofire/pull/1419#discussion_r76539787","pull_request_url":"https://api.github.com/repos/Alamofire/Alamofire/pulls/1419","_links":{"self":{"href":"https://api.github.com/repos/Alamofire/Alamofire/pulls/comments/76539787"},"html":{"href":"https://github.com/Alamofire/Alamofire/pull/1419#discussion_r76539787"},"pull_request":{"href":"https://api.github.com/repos/Alamofire/Alamofire/pulls/1419"}}},"pull_request":{"url":"https://api.github.com/repos/Alamofire/Alamofire/pulls/1419","id":82142656,"html_url":"https://github.com/Alamofire/Alamofire/pull/1419","diff_url":"https://github.com/Alamofire/Alamofire/pull/1419.diff","patch_url":"https://github.com/Alamofire/Alamofire/pull/1419.patch","issue_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1419","number":1419,"state":"open","locked":false,"title":"New Error Handling","user":{"login":"jshier","id":51020,"avatar_url":"https://avatars.githubusercontent.com/u/51020?v=3","gravatar_id":"","url":"https://api.github.com/users/jshier","html_url":"https://github.com/jshier","followers_url":"https://api.github.com/users/jshier/followers","following_url":"https://api.github.com/users/jshier/following{/other_user}","gists_url":"https://api.github.com/users/jshier/gists{/gist_id}","starred_url":"https://api.github.com/users/jshier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jshier/subscriptions","organizations_url":"https://api.github.com/users/jshier/orgs","repos_url":"https://api.github.com/users/jshier/repos","events_url":"https://api.github.com/users/jshier/events{/privacy}","received_events_url":"https://api.github.com/users/jshier/received_events","type":"User","site_admin":false},"body":"This PR refactors Alamofire's error handling to be based around a new `AFError` type rather than `NSError`, as Swift 3 has pushed the system frameworks and consumers toward using `Error` for everything. \r\n\r\n`AFError` consists of a few base cases with reason types for each. Convenience booleans and other properties have been added to make interacting with type easier in end use scenarios.\r\n\r\nThis PR is a works in progress as the inline and separate documentation still needs to be completed and the tests need to be updated for the new error type.","created_at":"2016-08-22T07:03:16Z","updated_at":"2016-08-28T21:47:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9b1a4feaf060ebe909b82d6248bfc4a5bb9e2b9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Alamofire/Alamofire/pulls/1419/commits","review_comments_url":"https://api.github.com/repos/Alamofire/Alamofire/pulls/1419/comments","review_comment_url":"https://api.github.com/repos/Alamofire/Alamofire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/1419/comments","statuses_url":"https://api.github.com/repos/Alamofire/Alamofire/statuses/89c5a5a4959ef2bbad4b00df14a6b17f56916c0f","head":{"label":"Alamofire:new-error-handling","ref":"new-error-handling","sha":"89c5a5a4959ef2bbad4b00df14a6b17f56916c0f","user":{"login":"Alamofire","id":7774181,"avatar_url":"https://avatars.githubusercontent.com/u/7774181?v=3","gravatar_id":"","url":"https://api.github.com/users/Alamofire","html_url":"https://github.com/Alamofire","followers_url":"https://api.github.com/users/Alamofire/followers","following_url":"https://api.github.com/users/Alamofire/following{/other_user}","gists_url":"https://api.github.com/users/Alamofire/gists{/gist_id}","starred_url":"https://api.github.com/users/Alamofire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alamofire/subscriptions","organizations_url":"https://api.github.com/users/Alamofire/orgs","repos_url":"https://api.github.com/users/Alamofire/repos","events_url":"https://api.github.com/users/Alamofire/events{/privacy}","received_events_url":"https://api.github.com/users/Alamofire/received_events","type":"Organization","site_admin":false},"repo":{"id":22458259,"name":"Alamofire","full_name":"Alamofire/Alamofire","owner":{"login":"Alamofire","id":7774181,"avatar_url":"https://avatars.githubusercontent.com/u/7774181?v=3","gravatar_id":"","url":"https://api.github.com/users/Alamofire","html_url":"https://github.com/Alamofire","followers_url":"https://api.github.com/users/Alamofire/followers","following_url":"https://api.github.com/users/Alamofire/following{/other_user}","gists_url":"https://api.github.com/users/Alamofire/gists{/gist_id}","starred_url":"https://api.github.com/users/Alamofire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alamofire/subscriptions","organizations_url":"https://api.github.com/users/Alamofire/orgs","repos_url":"https://api.github.com/users/Alamofire/repos","events_url":"https://api.github.com/users/Alamofire/events{/privacy}","received_events_url":"https://api.github.com/users/Alamofire/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Alamofire/Alamofire","description":"Elegant HTTP Networking in Swift","fork":false,"url":"https://api.github.com/repos/Alamofire/Alamofire","forks_url":"https://api.github.com/repos/Alamofire/Alamofire/forks","keys_url":"https://api.github.com/repos/Alamofire/Alamofire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alamofire/Alamofire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alamofire/Alamofire/teams","hooks_url":"https://api.github.com/repos/Alamofire/Alamofire/hooks","issue_events_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/events{/number}","events_url":"https://api.github.com/repos/Alamofire/Alamofire/events","assignees_url":"https://api.github.com/repos/Alamofire/Alamofire/assignees{/user}","branches_url":"https://api.github.com/repos/Alamofire/Alamofire/branches{/branch}","tags_url":"https://api.github.com/repos/Alamofire/Alamofire/tags","blobs_url":"https://api.github.com/repos/Alamofire/Alamofire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alamofire/Alamofire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alamofire/Alamofire/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alamofire/Alamofire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alamofire/Alamofire/statuses/{sha}","languages_url":"https://api.github.com/repos/Alamofire/Alamofire/languages","stargazers_url":"https://api.github.com/repos/Alamofire/Alamofire/stargazers","contributors_url":"https://api.github.com/repos/Alamofire/Alamofire/contributors","subscribers_url":"https://api.github.com/repos/Alamofire/Alamofire/subscribers","subscription_url":"https://api.github.com/repos/Alamofire/Alamofire/subscription","commits_url":"https://api.github.com/repos/Alamofire/Alamofire/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alamofire/Alamofire/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alamofire/Alamofire/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alamofire/Alamofire/contents/{+path}","compare_url":"https://api.github.com/repos/Alamofire/Alamofire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alamofire/Alamofire/merges","archive_url":"https://api.github.com/repos/Alamofire/Alamofire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alamofire/Alamofire/downloads","issues_url":"https://api.github.com/repos/Alamofire/Alamofire/issues{/number}","pulls_url":"https://api.github.com/repos/Alamofire/Alamofire/pulls{/number}","milestones_url":"https://api.github.com/repos/Alamofire/Alamofire/milestones{/number}","notifications_url":"https://api.github.com/repos/Alamofire/Alamofire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alamofire/Alamofire/labels{/name}","releases_url":"https://api.github.com/repos/Alamofire/Alamofire/releases{/id}","deployments_url":"https://api.github.com/repos/Alamofire/Alamofire/deployments","created_at":"2014-07-31T05:56:19Z","updated_at":"2016-08-28T18:09:37Z","pushed_at":"2016-08-28T21:46:08Z","git_url":"git://github.com/Alamofire/Alamofire.git","ssh_url":"git@github.com:Alamofire/Alamofire.git","clone_url":"https://github.com/Alamofire/Alamofire.git","svn_url":"https://github.com/Alamofire/Alamofire","homepage":"","size":3710,"stargazers_count":18800,"watchers_count":18800,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2986,"mirror_url":null,"open_issues_count":31,"forks":2986,"open_issues":31,"watchers":18800,"default_branch":"master"}},"base":{"label":"Alamofire:swift3","ref":"swift3","sha":"3cc5b4e8453bec9fd6b973d60e6b0605a38e4cf4","user":{"login":"Alamofire","id":7774181,"avatar_url":"https://avatars.githubusercontent.com/u/7774181?v=3","gravatar_id":"","url":"https://api.github.com/users/Alamofire","html_url":"https://github.com/Alamofire","followers_url":"https://api.github.com/users/Alamofire/followers","following_url":"https://api.github.com/users/Alamofire/following{/other_user}","gists_url":"https://api.github.com/users/Alamofire/gists{/gist_id}","starred_url":"https://api.github.com/users/Alamofire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alamofire/subscriptions","organizations_url":"https://api.github.com/users/Alamofire/orgs","repos_url":"https://api.github.com/users/Alamofire/repos","events_url":"https://api.github.com/users/Alamofire/events{/privacy}","received_events_url":"https://api.github.com/users/Alamofire/received_events","type":"Organization","site_admin":false},"repo":{"id":22458259,"name":"Alamofire","full_name":"Alamofire/Alamofire","owner":{"login":"Alamofire","id":7774181,"avatar_url":"https://avatars.githubusercontent.com/u/7774181?v=3","gravatar_id":"","url":"https://api.github.com/users/Alamofire","html_url":"https://github.com/Alamofire","followers_url":"https://api.github.com/users/Alamofire/followers","following_url":"https://api.github.com/users/Alamofire/following{/other_user}","gists_url":"https://api.github.com/users/Alamofire/gists{/gist_id}","starred_url":"https://api.github.com/users/Alamofire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alamofire/subscriptions","organizations_url":"https://api.github.com/users/Alamofire/orgs","repos_url":"https://api.github.com/users/Alamofire/repos","events_url":"https://api.github.com/users/Alamofire/events{/privacy}","received_events_url":"https://api.github.com/users/Alamofire/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Alamofire/Alamofire","description":"Elegant HTTP Networking in Swift","fork":false,"url":"https://api.github.com/repos/Alamofire/Alamofire","forks_url":"https://api.github.com/repos/Alamofire/Alamofire/forks","keys_url":"https://api.github.com/repos/Alamofire/Alamofire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alamofire/Alamofire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alamofire/Alamofire/teams","hooks_url":"https://api.github.com/repos/Alamofire/Alamofire/hooks","issue_events_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/events{/number}","events_url":"https://api.github.com/repos/Alamofire/Alamofire/events","assignees_url":"https://api.github.com/repos/Alamofire/Alamofire/assignees{/user}","branches_url":"https://api.github.com/repos/Alamofire/Alamofire/branches{/branch}","tags_url":"https://api.github.com/repos/Alamofire/Alamofire/tags","blobs_url":"https://api.github.com/repos/Alamofire/Alamofire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alamofire/Alamofire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alamofire/Alamofire/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alamofire/Alamofire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alamofire/Alamofire/statuses/{sha}","languages_url":"https://api.github.com/repos/Alamofire/Alamofire/languages","stargazers_url":"https://api.github.com/repos/Alamofire/Alamofire/stargazers","contributors_url":"https://api.github.com/repos/Alamofire/Alamofire/contributors","subscribers_url":"https://api.github.com/repos/Alamofire/Alamofire/subscribers","subscription_url":"https://api.github.com/repos/Alamofire/Alamofire/subscription","commits_url":"https://api.github.com/repos/Alamofire/Alamofire/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alamofire/Alamofire/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alamofire/Alamofire/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alamofire/Alamofire/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alamofire/Alamofire/contents/{+path}","compare_url":"https://api.github.com/repos/Alamofire/Alamofire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alamofire/Alamofire/merges","archive_url":"https://api.github.com/repos/Alamofire/Alamofire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alamofire/Alamofire/downloads","issues_url":"https://api.github.com/repos/Alamofire/Alamofire/issues{/number}","pulls_url":"https://api.github.com/repos/Alamofire/Alamofire/pulls{/number}","milestones_url":"https://api.github.com/repos/Alamofire/Alamofire/milestones{/number}","notifications_url":"https://api.github.com/repos/Alamofire/Alamofire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alamofire/Alamofire/labels{/name}","releases_url":"https://api.github.com/repos/Alamofire/Alamofire/releases{/id}","deployments_url":"https://api.github.com/repos/Alamofire/Alamofire/deployments","created_at":"2014-07-31T05:56:19Z","updated_at":"2016-08-28T18:09:37Z","pushed_at":"2016-08-28T21:46:08Z","git_url":"git://github.com/Alamofire/Alamofire.git","ssh_url":"git@github.com:Alamofire/Alamofire.git","clone_url":"https://github.com/Alamofire/Alamofire.git","svn_url":"https://github.com/Alamofire/Alamofire","homepage":"","size":3710,"stargazers_count":18800,"watchers_count":18800,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2986,"mirror_url":null,"open_issues_count":31,"forks":2986,"open_issues":31,"watchers":18800,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Alamofire/Alamofire/pulls/1419"},"html":{"href":"https://github.com/Alamofire/Alamofire/pull/1419"},"issue":{"href":"https://api.github.com/repos/Alamofire/Alamofire/issues/1419"},"comments":{"href":"https://api.github.com/repos/Alamofire/Alamofire/issues/1419/comments"},"review_comments":{"href":"https://api.github.com/repos/Alamofire/Alamofire/pulls/1419/comments"},"review_comment":{"href":"https://api.github.com/repos/Alamofire/Alamofire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Alamofire/Alamofire/pulls/1419/commits"},"statuses":{"href":"https://api.github.com/repos/Alamofire/Alamofire/statuses/89c5a5a4959ef2bbad4b00df14a6b17f56916c0f"}}}}
{"actor":{"display_login":"jshier"}}