{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/1750","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1750/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1750/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1750/events","html_url":"https://github.com/realm/realm-cocoa/issues/1750","id":68097263,"number":1750,"title":"Allow error handling when realm is accessed with the wrong encryption key","user":{"login":"issue2k","id":2473372,"avatar_url":"https://avatars.githubusercontent.com/u/2473372?v=3","gravatar_id":"","url":"https://api.github.com/users/issue2k","html_url":"https://github.com/issue2k","followers_url":"https://api.github.com/users/issue2k/followers","following_url":"https://api.github.com/users/issue2k/following{/other_user}","gists_url":"https://api.github.com/users/issue2k/gists{/gist_id}","starred_url":"https://api.github.com/users/issue2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issue2k/subscriptions","organizations_url":"https://api.github.com/users/issue2k/orgs","repos_url":"https://api.github.com/users/issue2k/repos","events_url":"https://api.github.com/users/issue2k/events{/privacy}","received_events_url":"https://api.github.com/users/issue2k/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/realm/realm-cocoa/labels/pending","name":"pending","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-04-13T13:32:39Z","updated_at":"2015-04-20T23:12:09Z","closed_at":null,"body":"Currently the realmWithPath method indicates that there is some error handling possible. I would expect that when accessing a realm with wrong encryption key, it just gives an error. Instead its throwing an exception which causes a crash of the app. As i am not able to handle C++ exceptions on 32bit devices (And i want to avoid handling the control flow by catching exceptions) it would be helpful if realm would not throw an exception and give a useful error message and a uniqe code to be able to handle it.\r\n\r\nThis is what i am trying to do:\r\n\r\n```[RLMRealm realmWithPath:RLMRealm.defaultRealmPath encryptionKey:key readOnly:NO error:&error]```\r\n\r\non 64bit devices i am able to handle the thrown C++ exceptions. On 32bit devices there seems to be no way:\r\n\r\n```libc++abi.dylib: terminating with uncaught exception of type tightdb::util::DecryptionFailed: Decryption failed```\r\n\r\nAny change or other idea how i could handle this case without crashing on 32 bit devices?"},"comment":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/comments/94589880","html_url":"https://github.com/realm/realm-cocoa/issues/1750#issuecomment-94589880","issue_url":"https://api.github.com/repos/realm/realm-cocoa/issues/1750","id":94589880,"user":{"login":"tgoyne","id":408944,"avatar_url":"https://avatars.githubusercontent.com/u/408944?v=3","gravatar_id":"","url":"https://api.github.com/users/tgoyne","html_url":"https://github.com/tgoyne","followers_url":"https://api.github.com/users/tgoyne/followers","following_url":"https://api.github.com/users/tgoyne/following{/other_user}","gists_url":"https://api.github.com/users/tgoyne/gists{/gist_id}","starred_url":"https://api.github.com/users/tgoyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgoyne/subscriptions","organizations_url":"https://api.github.com/users/tgoyne/orgs","repos_url":"https://api.github.com/users/tgoyne/repos","events_url":"https://api.github.com/users/tgoyne/events{/privacy}","received_events_url":"https://api.github.com/users/tgoyne/received_events","type":"User","site_admin":false},"created_at":"2015-04-20T23:12:09Z","updated_at":"2015-04-20T23:12:09Z","body":"Rebuilding core with Xcode 6.3 doesn't eliminate the warning, so I don't think there's anything we can do."}}