RLMSyncError

enum RLMSyncError : NSInteger {}

An error related to a problem that might be reported by the synchronization manager error handler, or a callback on a sync-related API that performs asynchronous work.

  • An error that indicates that the response received from the authentication server was malformed.

    Warning

    This error is deprecated, and has been replaced by RLMSyncAuthErrorBadResponse.

    Declaration

    Objective-C

    RLMSyncErrorBadResponse = 1
  • An error that indicates a problem with the session (a specific Realm opened for sync).

    Declaration

    Objective-C

    RLMSyncErrorClientSessionError = 4
  • An error that indicates a problem with a specific user.

    Declaration

    Objective-C

    RLMSyncErrorClientUserError = 5
  • An error that indicates an internal, unrecoverable problem with the underlying synchronization engine.

    Declaration

    Objective-C

    RLMSyncErrorClientInternalError = 6
  • An error that indicates the Realm needs to be reset.

    A synced Realm may need to be reset because the Realm Object Server encountered an error and had to be restored from a backup. If the backup copy of the remote Realm is of an earlier version than the local copy of the Realm, the server will ask the client to reset the Realm.

    The reset process is as follows: the local copy of the Realm is copied into a recovery directory for safekeeping, and then deleted from the original location. The next time the Realm for that URL is opened, the Realm will automatically be re-downloaded from the Realm Object Server, and can be used as normal.

    Data written to the Realm after the local copy of the Realm diverged from the backup remote copy will be present in the local recovery copy of the Realm file. The re-downloaded Realm will initially contain only the data present at the time the Realm was backed up on the server.

    The client reset process can be initiated in one of two ways. The block provided in the userInfo dictionary under kRLMSyncInitiateClientResetBlockKey can be called to initiate the reset process. This block can be called any time after the error is received, but should only be called if and when your app closes and invalidates every instance of the offending Realm on all threads (note that autorelease pools may make this difficult to guarantee).

    If the block is not called, the client reset process will be automatically carried out the next time the app is launched and the RLMSyncManager singleton is accessed.

    The value for the kRLMSyncPathOfRealmBackupCopyKey key in the userInfo dictionary describes the path of the recovered copy of the Realm. This copy will not actually be created until the client reset process is initiated.

    See

    -[NSError rlmSync_clientResetBlock], -[NSError rlmSync_clientResetBackedUpRealmPath]

    Declaration

    Objective-C

    RLMSyncErrorClientResetError = 7
  • An error that indicates an authentication error occurred.

    The kRLMSyncUnderlyingErrorKey key in the user info dictionary will contain the underlying error, which is guaranteed to be under the RLMSyncAuthErrorDomain error domain.

    Declaration

    Objective-C

    RLMSyncErrorUnderlyingAuthError = 8