{"action":"created","comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments/63260449","id":63260449,"diff_hunk":"@@ -236,18 +236,25 @@ BOOL RLMIsObjectValidForProperty(__unsafe_unretained id const obj,\n }\n \n NSError *RLMMakeError(RLMError code, const realm::RealmFileException& exception) {\n+    NSString *underlying = @(exception.underlying().c_str());\n     return [NSError errorWithDomain:RLMErrorDomain\n                                code:code\n                            userInfo:@{NSLocalizedDescriptionKey: @(exception.what()),\n                                       NSFilePathErrorKey: @(exception.path().c_str()),\n-                                      @\"Error Code\": @(code)}];\n+                                      @\"Error Code\": @(code),\n+                                      @\"Underlying\": underlying.length == 0 ? @\"n/a\" : underlying}];\n }\n \n NSError *RLMMakeError(std::system_error const& exception) {\n-    return [NSError errorWithDomain:RLMErrorDomain\n+    BOOL isGenericCategoryError = (exception.code().category() == std::generic_category());\n+    NSString *category = @(exception.code().category().name());\n+    NSString *errorDomain = isGenericCategoryError ? NSPOSIXErrorDomain : RLMUnknownSystemErrorDomain;","path":"Realm/RLMUtil.mm","position":18,"original_position":18,"commit_id":"09453ee5c61e66a0aab6c70fd4a46ffdbcc85ffb","original_commit_id":"09453ee5c61e66a0aab6c70fd4a46ffdbcc85ffb","user":{"login":"austinzheng","id":3687054,"avatar_url":"https://avatars.githubusercontent.com/u/3687054?v=3","gravatar_id":"","url":"https://api.github.com/users/austinzheng","html_url":"https://github.com/austinzheng","followers_url":"https://api.github.com/users/austinzheng/followers","following_url":"https://api.github.com/users/austinzheng/following{/other_user}","gists_url":"https://api.github.com/users/austinzheng/gists{/gist_id}","starred_url":"https://api.github.com/users/austinzheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austinzheng/subscriptions","organizations_url":"https://api.github.com/users/austinzheng/orgs","repos_url":"https://api.github.com/users/austinzheng/repos","events_url":"https://api.github.com/users/austinzheng/events{/privacy}","received_events_url":"https://api.github.com/users/austinzheng/received_events","type":"User","site_admin":false},"body":"Got it. Thanks.","created_at":"2016-05-13T22:36:26Z","updated_at":"2016-05-13T22:36:26Z","html_url":"https://github.com/realm/realm-cocoa/pull/3560#discussion_r63260449","pull_request_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/3560","_links":{"self":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments/63260449"},"html":{"href":"https://github.com/realm/realm-cocoa/pull/3560#discussion_r63260449"},"pull_request":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/3560"}}},"pull_request":{"url":"https://api.github.com/repos/realm/realm-cocoa/pulls/3560","id":69749426,"html_url":"https://github.com/realm/realm-cocoa/pull/3560","diff_url":"https://github.com/realm/realm-cocoa/pull/3560.diff","patch_url":"https://github.com/realm/realm-cocoa/pull/3560.patch","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3560","number":3560,"state":"open","locked":false,"title":"Adding better error domain support for system errors","user":{"login":"austinzheng","id":3687054,"avatar_url":"https://avatars.githubusercontent.com/u/3687054?v=3","gravatar_id":"","url":"https://api.github.com/users/austinzheng","html_url":"https://github.com/austinzheng","followers_url":"https://api.github.com/users/austinzheng/followers","following_url":"https://api.github.com/users/austinzheng/following{/other_user}","gists_url":"https://api.github.com/users/austinzheng/gists{/gist_id}","starred_url":"https://api.github.com/users/austinzheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austinzheng/subscriptions","organizations_url":"https://api.github.com/users/austinzheng/orgs","repos_url":"https://api.github.com/users/austinzheng/repos","events_url":"https://api.github.com/users/austinzheng/events{/privacy}","received_events_url":"https://api.github.com/users/austinzheng/received_events","type":"User","site_admin":false},"body":"A first shot at addressing #3069 and #3438. `NSError` objects created from system exceptions should be slightly more descriptive now. @bdash @tgoyne\r\n\r\nChanges:\r\n- Realm NSError now populated with the NSPOSIXErrorDomain when appropriate\r\n- NSError user info now contains system error category\r\n- Added RLMUnknownSystemErrorDomain for non-POSIX errors","created_at":"2016-05-11T21:58:47Z","updated_at":"2016-05-13T22:36:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7f9017ab5e9250cd65c8f37ac9d686c0b99251d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/3560/commits","review_comments_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/3560/comments","review_comment_url":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/3560/comments","statuses_url":"https://api.github.com/repos/realm/realm-cocoa/statuses/09453ee5c61e66a0aab6c70fd4a46ffdbcc85ffb","head":{"label":"austinzheng:master","ref":"master","sha":"09453ee5c61e66a0aab6c70fd4a46ffdbcc85ffb","user":{"login":"austinzheng","id":3687054,"avatar_url":"https://avatars.githubusercontent.com/u/3687054?v=3","gravatar_id":"","url":"https://api.github.com/users/austinzheng","html_url":"https://github.com/austinzheng","followers_url":"https://api.github.com/users/austinzheng/followers","following_url":"https://api.github.com/users/austinzheng/following{/other_user}","gists_url":"https://api.github.com/users/austinzheng/gists{/gist_id}","starred_url":"https://api.github.com/users/austinzheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austinzheng/subscriptions","organizations_url":"https://api.github.com/users/austinzheng/orgs","repos_url":"https://api.github.com/users/austinzheng/repos","events_url":"https://api.github.com/users/austinzheng/events{/privacy}","received_events_url":"https://api.github.com/users/austinzheng/received_events","type":"User","site_admin":false},"repo":{"id":57922492,"name":"realm-cocoa","full_name":"austinzheng/realm-cocoa","owner":{"login":"austinzheng","id":3687054,"avatar_url":"https://avatars.githubusercontent.com/u/3687054?v=3","gravatar_id":"","url":"https://api.github.com/users/austinzheng","html_url":"https://github.com/austinzheng","followers_url":"https://api.github.com/users/austinzheng/followers","following_url":"https://api.github.com/users/austinzheng/following{/other_user}","gists_url":"https://api.github.com/users/austinzheng/gists{/gist_id}","starred_url":"https://api.github.com/users/austinzheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austinzheng/subscriptions","organizations_url":"https://api.github.com/users/austinzheng/orgs","repos_url":"https://api.github.com/users/austinzheng/repos","events_url":"https://api.github.com/users/austinzheng/events{/privacy}","received_events_url":"https://api.github.com/users/austinzheng/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/austinzheng/realm-cocoa","description":"Realm is a mobile database: a replacement for Core Data & SQLite","fork":true,"url":"https://api.github.com/repos/austinzheng/realm-cocoa","forks_url":"https://api.github.com/repos/austinzheng/realm-cocoa/forks","keys_url":"https://api.github.com/repos/austinzheng/realm-cocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/austinzheng/realm-cocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/austinzheng/realm-cocoa/teams","hooks_url":"https://api.github.com/repos/austinzheng/realm-cocoa/hooks","issue_events_url":"https://api.github.com/repos/austinzheng/realm-cocoa/issues/events{/number}","events_url":"https://api.github.com/repos/austinzheng/realm-cocoa/events","assignees_url":"https://api.github.com/repos/austinzheng/realm-cocoa/assignees{/user}","branches_url":"https://api.github.com/repos/austinzheng/realm-cocoa/branches{/branch}","tags_url":"https://api.github.com/repos/austinzheng/realm-cocoa/tags","blobs_url":"https://api.github.com/repos/austinzheng/realm-cocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/austinzheng/realm-cocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/austinzheng/realm-cocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/austinzheng/realm-cocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/austinzheng/realm-cocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/austinzheng/realm-cocoa/languages","stargazers_url":"https://api.github.com/repos/austinzheng/realm-cocoa/stargazers","contributors_url":"https://api.github.com/repos/austinzheng/realm-cocoa/contributors","subscribers_url":"https://api.github.com/repos/austinzheng/realm-cocoa/subscribers","subscription_url":"https://api.github.com/repos/austinzheng/realm-cocoa/subscription","commits_url":"https://api.github.com/repos/austinzheng/realm-cocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/austinzheng/realm-cocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/austinzheng/realm-cocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/austinzheng/realm-cocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/austinzheng/realm-cocoa/contents/{+path}","compare_url":"https://api.github.com/repos/austinzheng/realm-cocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/austinzheng/realm-cocoa/merges","archive_url":"https://api.github.com/repos/austinzheng/realm-cocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/austinzheng/realm-cocoa/downloads","issues_url":"https://api.github.com/repos/austinzheng/realm-cocoa/issues{/number}","pulls_url":"https://api.github.com/repos/austinzheng/realm-cocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/austinzheng/realm-cocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/austinzheng/realm-cocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/austinzheng/realm-cocoa/labels{/name}","releases_url":"https://api.github.com/repos/austinzheng/realm-cocoa/releases{/id}","deployments_url":"https://api.github.com/repos/austinzheng/realm-cocoa/deployments","created_at":"2016-05-02T21:25:47Z","updated_at":"2016-05-02T21:25:51Z","pushed_at":"2016-05-13T18:40:38Z","git_url":"git://github.com/austinzheng/realm-cocoa.git","ssh_url":"git@github.com:austinzheng/realm-cocoa.git","clone_url":"https://github.com/austinzheng/realm-cocoa.git","svn_url":"https://github.com/austinzheng/realm-cocoa","homepage":"https://realm.io","size":40464,"stargazers_count":0,"watchers_count":0,"language":"Objective-C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"ee2c6a659012c69bfa9950bcf62700949b2177d5","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":4044891,"name":"realm-cocoa","full_name":"realm/realm-cocoa","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-cocoa","description":"Realm is a mobile database: a replacement for Core Data & SQLite","fork":false,"url":"https://api.github.com/repos/realm/realm-cocoa","forks_url":"https://api.github.com/repos/realm/realm-cocoa/forks","keys_url":"https://api.github.com/repos/realm/realm-cocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-cocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-cocoa/teams","hooks_url":"https://api.github.com/repos/realm/realm-cocoa/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-cocoa/events","assignees_url":"https://api.github.com/repos/realm/realm-cocoa/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-cocoa/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-cocoa/tags","blobs_url":"https://api.github.com/repos/realm/realm-cocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-cocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-cocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-cocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-cocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-cocoa/languages","stargazers_url":"https://api.github.com/repos/realm/realm-cocoa/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-cocoa/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-cocoa/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-cocoa/subscription","commits_url":"https://api.github.com/repos/realm/realm-cocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-cocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-cocoa/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-cocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-cocoa/merges","archive_url":"https://api.github.com/repos/realm/realm-cocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-cocoa/downloads","issues_url":"https://api.github.com/repos/realm/realm-cocoa/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-cocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-cocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-cocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-cocoa/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-cocoa/releases{/id}","deployments_url":"https://api.github.com/repos/realm/realm-cocoa/deployments","created_at":"2012-04-16T20:06:56Z","updated_at":"2016-05-13T19:05:52Z","pushed_at":"2016-05-13T22:24:34Z","git_url":"git://github.com/realm/realm-cocoa.git","ssh_url":"git@github.com:realm/realm-cocoa.git","clone_url":"https://github.com/realm/realm-cocoa.git","svn_url":"https://github.com/realm/realm-cocoa","homepage":"https://realm.io","size":119095,"stargazers_count":7345,"watchers_count":7345,"language":"Objective-C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":779,"mirror_url":null,"open_issues_count":180,"forks":779,"open_issues":180,"watchers":7345,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/3560"},"html":{"href":"https://github.com/realm/realm-cocoa/pull/3560"},"issue":{"href":"https://api.github.com/repos/realm/realm-cocoa/issues/3560"},"comments":{"href":"https://api.github.com/repos/realm/realm-cocoa/issues/3560/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/3560/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/realm/realm-cocoa/pulls/3560/commits"},"statuses":{"href":"https://api.github.com/repos/realm/realm-cocoa/statuses/09453ee5c61e66a0aab6c70fd4a46ffdbcc85ffb"}}}}