{"action":"closed","issue":{"url":"https://api.github.com/repos/ably/ably-ios/issues/126","repository_url":"https://api.github.com/repos/ably/ably-ios","labels_url":"https://api.github.com/repos/ably/ably-ios/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/ably/ably-ios/issues/126/comments","events_url":"https://api.github.com/repos/ably/ably-ios/issues/126/events","html_url":"https://github.com/ably/ably-ios/issues/126","id":126404045,"number":126,"title":"Core: `ARTErrorInfo` should be related with `NSError`","user":{"login":"ricardopereira","id":3541185,"avatar_url":"https://avatars.githubusercontent.com/u/3541185?v=3","gravatar_id":"","url":"https://api.github.com/users/ricardopereira","html_url":"https://github.com/ricardopereira","followers_url":"https://api.github.com/users/ricardopereira/followers","following_url":"https://api.github.com/users/ricardopereira/following{/other_user}","gists_url":"https://api.github.com/users/ricardopereira/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardopereira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardopereira/subscriptions","organizations_url":"https://api.github.com/users/ricardopereira/orgs","repos_url":"https://api.github.com/users/ricardopereira/repos","events_url":"https://api.github.com/users/ricardopereira/events{/privacy}","received_events_url":"https://api.github.com/users/ricardopereira/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ably/ably-ios/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"ricardopereira","id":3541185,"avatar_url":"https://avatars.githubusercontent.com/u/3541185?v=3","gravatar_id":"","url":"https://api.github.com/users/ricardopereira","html_url":"https://github.com/ricardopereira","followers_url":"https://api.github.com/users/ricardopereira/followers","following_url":"https://api.github.com/users/ricardopereira/following{/other_user}","gists_url":"https://api.github.com/users/ricardopereira/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardopereira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardopereira/subscriptions","organizations_url":"https://api.github.com/users/ricardopereira/orgs","repos_url":"https://api.github.com/users/ricardopereira/repos","events_url":"https://api.github.com/users/ricardopereira/events{/privacy}","received_events_url":"https://api.github.com/users/ricardopereira/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-01-13T12:02:36Z","updated_at":"2016-04-05T23:16:39Z","closed_at":"2016-04-05T23:16:39Z","body":"**Problem:**\r\nTo many inconsistencies on how to encapsulate an error in the client.\r\n\r\n**e.g.** two different callback types where one uses `NSError` and another uses `ARTErrorInfo`:\r\n``` swift\r\npublic typealias ARTStatsCallback = (ARTPaginatedResult?, NSError?) -> Void\r\n\r\npublic typealias ARTRealtimeChannelMessageCb = (ARTMessage, ARTErrorInfo?) -> Void\r\n```\r\n\r\n**Two solutions:**\r\n 1. `ARTErrorInfo` should have `NSError` has base class\r\n 2. Remove `ARTErrorInfo` and just use `NSError`\r\n\r\n[`NSError`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSError_Class/) is the error object from Cocoa.\r\nIt has:\r\n - `code`: Int\r\n - `domain`: String\r\n - `userInfo`: Dictionary (user info dictionary)\r\n\r\n\r\nIMO\r\nwe can do _2._ because the `NSError` has a `userInfo` property where we can add more data if we need.\r\n"}}