RLMError

Objective-C

enum RLMError : NSInteger {}

Swift

typealias RLMError.Code._ErrorType = RLMError

RLMError is an enumeration representing all recoverable errors. It is associated with the Realm error domain specified in RLMErrorDomain.

  • Denotes a general error that occurred when trying to open a Realm.

    Declaration

    Objective-C

    RLMErrorFail = 1

    Swift

    case fail = 1
  • Denotes a file I/O error that occurred when trying to open a Realm.

    Declaration

    Objective-C

    RLMErrorFileAccess = 2

    Swift

    case fileAccess = 2
  • Denotes a file permission error that occurred when trying to open a Realm.

    This error can occur if the user does not have permission to open or create the specified file in the specified access mode when opening a Realm.

    Declaration

    Objective-C

    RLMErrorFilePermissionDenied = 3

    Swift

    case filePermissionDenied = 3
  • Denotes an error where a file was to be written to disk, but another file with the same name already exists.

    Declaration

    Objective-C

    RLMErrorFileExists = 4

    Swift

    case fileExists = 4
  • Denotes an error that occurs if a file could not be found.

    This error may occur if a Realm file could not be found on disk when trying to open a Realm as read-only, or if the directory part of the specified path was not found when trying to write a copy.

    Declaration

    Objective-C

    RLMErrorFileNotFound = 5

    Swift

    case fileNotFound = 5
  • Denotes an error that occurs if a file format upgrade is required to open the file, but upgrades were explicitly disabled or the file is being open in read-only mode.

    Declaration

    Objective-C

    RLMErrorFileFormatUpgradeRequired = 6

    Swift

    case fileFormatUpgradeRequired = 6
  • Denotes an error that occurs if the database file is currently open in another process which cannot share with the current process due to an architecture mismatch.

    This error may occur if trying to share a Realm file between an i386 (32-bit) iOS Simulator and the Realm Studio application. In this case, please use the 64-bit version of the iOS Simulator.

    Declaration

    Objective-C

    RLMErrorIncompatibleLockFile = 8

    Swift

    case incompatibleLockFile = 8
  • Denotes an error that occurs when there is insufficient available address space to mmap the Realm file.

    Declaration

    Objective-C

    RLMErrorAddressSpaceExhausted = 9

    Swift

    case addressSpaceExhausted = 9
  • Denotes an error that occurs if there is a schema version mismatch and a migration is required.

    Declaration

    Objective-C

    RLMErrorSchemaMismatch = 10

    Swift

    case schemaMismatch = 10
  • Denotes an error where an operation was requested which cannot be performed on an open file.

    Declaration

    Objective-C

    RLMErrorAlreadyOpen = 12

    Swift

    case alreadyOpen = 12
  • Denotes an error where an input value was invalid.

    Declaration

    Objective-C

    RLMErrorInvalidInput = 13

    Swift

    case invalidInput = 13
  • Denotes an error where a write failed due to insufficient disk space.

    Declaration

    Objective-C

    RLMErrorOutOfDiskSpace = 14

    Swift

    case outOfDiskSpace = 14
  • Denotes an error where a Realm file could not be opened because another process has opened the same file in a way incompatible with inter-process sharing. For example, this can result from opening the backing file for an in-memory Realm in non-in-memory mode.

    Declaration

    Objective-C

    RLMErrorIncompatibleSession = 15

    Swift

    case incompatibleSession = 15
  • Denotes an error that occurs if the file is a valid Realm file, but has a file format version which is not supported by this version of Realm. This typically means that the file was written by a newer version of Realm, but may also mean that it is from a pre-1.0 version of Realm (or for synchronized files, pre-10.0).

    Declaration

    Objective-C

    RLMErrorUnsupportedFileFormatVersion = 16

    Swift

    case unsupportedFileFormatVersion = 16
  • Denotes an error that occurs if a synchronized Realm is opened in more than one process at once.

    Declaration

    Objective-C

    RLMErrorMultipleSyncAgents = 17

    Swift

    case multipleSyncAgents = 17
  • A subscription was rejected by the server.

    Declaration

    Objective-C

    RLMErrorSubscriptionFailed = 18

    Swift

    case subscriptionFailed = 18
  • A file operation failed in a way which does not have a more specific error code.

    Declaration

    Objective-C

    RLMErrorFileOperationFailed = 19

    Swift

    case fileOperationFailed = 19
  • Denotes an error that occurs if the file being opened is not a valid Realm file. Some of the possible causes of this are:

    1. The file at the given URL simply isn’t a Realm file at all.
    2. The wrong encryption key was given.
    3. The Realm file is encrypted and no encryption key was given.
    4. The Realm file isn’t encrypted but an encryption key was given.
    5. The file on disk has become corrupted.

    Declaration

    Objective-C

    RLMErrorInvalidDatabase = 20

    Swift

    case invalidDatabase = 20
  • Denotes an error that occurs if a Realm is opened in the wrong history mode. Typically this means that either a local Realm is being opened as a synchronized Realm or vice versa.

    Declaration

    Objective-C

    RLMErrorIncompatibleHistories = 21

    Swift

    case incompatibleHistories = 21
  • Denotes an error that occurs if objects were written to a flexible sync Realm without any active subscriptions for that object type. All objects created in flexible sync Realms must match at least one active subscription or the server will reject the write.

    Declaration

    Objective-C

    RLMErrorNoSubscriptionForWrite = 22

    Swift

    case noSubscriptionForWrite = 22