PSPDFInstantError

enum PSPDFInstantError {}

Possible error codes in the PSPDFInstantErrorDomain.

  • The error is unknown to Instant. The underlying error will be placed in NSUnderlyingErrorKey in the userInfo.

    Declaration

    Objective-C

    PSPDFInstantErrorUnknown = 1

    Swift

    case unknown = 1
  • The feature you were trying to use is not supported in the context of Instant.

    This will, for example, happen when you call -[PSPDFDocument saveWithOptions:error:] on documents managed by Instant.

    Declaration

    Objective-C

    PSPDFInstantErrorFeatureUnsupported = 2

    Swift

    case featureUnsupported = 2
  • The document that you were trying to operate on is invalid or unknown to Instant.

    Declaration

    Objective-C

    PSPDFInstantErrorInvalidDocument = 3

    Swift

    case invalidDocument = 3
  • The JWT you provided to authenticate has been rejected.

    This error code is relevant when you are attempting to reauthenticate a document descriptor:
    Since the access to a document can be revoked at any time, it is possible that even a freshly obtained JWT is rejected by PSPDFKit Server when you try to reauthenticate that document descriptor. When this happens, -[PSPDFInstantClientDelegate instantClient:documentDescriptor:didFailReauthenticationWithError:] will be called with this error code on PSPDFInstantClient.delegate.

    Note

    The layer’s backing storage will not be removed from disk! You can still access and modify that descriptor’s editableDocument. Any changes you make to it will, however, not be synced anymore until the descriptor has been successfully reauthenticated.

    Declaration

    Objective-C

    PSPDFInstantErrorAccessDenied = 4

    Swift

    case accessDenied = 4
  • Error indicating an attempt was made to download a document that has already been downloaded. The error will have a document descriptor under PSPDFInstantErrorDocumentDescriptorKey in the user info.

    Declaration

    Objective-C

    PSPDFInstantErrorAlreadyDownloaded = 5

    Swift

    case alreadyDownloaded = 5
  • Reading from or writing to the annotation database failed.

    Whenever possible, the SQLite (extended) error code can be found under the user info key PSPDFInstantErrorSQLiteExtendedErrorCodeKey as an NSNumber.

    Declaration

    Objective-C

    PSPDFInstantErrorDatabaseAccessFailed = 6

    Swift

    case databaseAccessFailed = 6
  • Writing a PDF or metadata file to disk failed.

    Note

    This does not refer to database errors: Those will be reported with PSPDFInstantErrorDatabaseAccessFailed, with an appropriate SQLite extended error code.
    Instead, this error code is relevant for downloading documents.

    Declaration

    Objective-C

    PSPDFInstantErrorCouldNotWriteToDisk = 7

    Swift

    case couldNotWriteToDisk = 7
  • The URL you have used is invalid for this purpose.

    Declaration

    Objective-C

    PSPDFInstantErrorInvalidURL = 8

    Swift

    case invalidURL = 8
  • Error returned when an attempt is made to save a document managed by Instant. The error will have a document under PSPDFInstantErrorDocumentKey in the user info.

    Declaration

    Objective-C

    PSPDFInstantErrorSavingDisabled = 9

    Swift

    case savingDisabled = 9
  • Error returned when the document passed into -[PSPDFInstantDocumentDescriptor annotationWithIdentifier:forDocument:error] is not managed by the receiver.

    Declaration

    Objective-C

    PSPDFInstantErrorUnmanagedDocument = 10

    Swift

    case unmanagedDocument = 10
  • Error returned when the receiver does not know of an annotation for the identifier passed into -[PSPDFInstantDocumentDescriptor annotationWithIdentifier:forDocument:error].

    Declaration

    Objective-C

    PSPDFInstantErrorNoSuchAnnotation = 11

    Swift

    case noSuchAnnotation = 11
  • Error returned when the annotation passed into -[PSPDFInstantDocumentDescriptor identifierForAnnotation:error:] is not managed by the receiver.

    Declaration

    Objective-C

    PSPDFInstantErrorUnmanagedAnnotation = 12

    Swift

    case unmanagedAnnotation = 12
  • Retrieving an item from the disk cache failed.

    This can happen if the disk cache is modified by other means than Instant’s public API. Although less likely, this can also be caused by a defect of the disk itself.

    Declaration

    Objective-C

    PSPDFInstantErrorCouldNotReadFromDiskCache = 13

    Swift

    case couldNotReadFromDiskCache = 13
  • Removing an item from the disk cache filed.

    This can happen if the disk cache is modified by other means than Instant’s public API. Although less likely, this can also be caused by a defect of the disk itself.

    Declaration

    Objective-C

    PSPDFInstantErrorCouldNotRemoveDiskCacheEntries = 14

    Swift

    case couldNotRemoveDiskCacheEntries = 14
  • The operation could not be completed because the network request failed. This happens when offline.

    If you were syncing manually, retry at a later date. If you are using automatic synchronization via PSPDFInstantDocumentDescriptor.delayForSyncingLocalChanges, -[PSPDFInstantDocumentDescriptor startListeningForServerChanges], or PSPDFInstantViewController.shouldListenForServerChangesWhenVisible, there is not much for you to do: a re-attempt to sync will be scheduled at an appropriate time.
    However, you may still want to inform your users, that their local changes are not synced, though.

    Declaration

    Objective-C

    PSPDFInstantErrorRequestFailed = 16

    Swift

    case requestFailed = 16
  • The operation could not be completed because the server sent invalid data.

    If you ever see this error, please contact support.

    Declaration

    Objective-C

    PSPDFInstantErrorInvalidServerData = 17

    Swift

    case invalidServerData = 17
  • The operation could not be completed because the server rejected the request as invalid.

    If you ever see this error, please contact support.

    Declaration

    Objective-C

    PSPDFInstantErrorInvalidRequest = 18

    Swift

    case invalidRequest = 18
  • The operation could not be completed because the client and server have incompatible versions: the server expects a newer client.

    You need to update this framework in your app to a compatible version and release an update. If a user sees this on their device they need to update your app.

    In the default setting, PSPDFInstantViewController.shouldShowCriticalErrors causes an alert to be shown to the user when this error is encountered, saying that an app update is needed.
    If you have your own error handling for this situation you can safely set that property to NO.

    Declaration

    Objective-C

    PSPDFInstantErrorOldClient = 21

    Swift

    case oldClient = 21
  • The operation could not be completed because the client and server have incompatible versions: the client is too new for the server.

    The server needs to be updated to a compatible version. You should update your server before releasing the updated client to ensure this error is never encountered on users’ devices.

    Declaration

    Objective-C

    PSPDFInstantErrorOldServer = 22

    Swift

    case oldServer = 22
  • The JWT you specified has an invalid format.

    Instant performs limited offline validation of the strings that you pass into methods that require a JWT before even contacting the server. JWTs must…

    1. consist of a header, payload, and signature part,
    2. the payload needs to be a base64 URL encoded JSON object,
    3. which — at the very least — needs to contain a string for the key document_id.

    The string you provided either violates at least one of these rules, or contains invalid data for an optional claim — such as layer_name or user_id. For details, please inspect the localizedDescription.

    Declaration

    Objective-C

    PSPDFInstantErrorInvalidJWT = 32

    Swift

    case invalidJWT = 32
  • The specified user ID is incompatible with the value stored on disk.

    To prevent data corruption, Instant verifies that you do not inadvertently “switch out” the user for a document descriptor. If the JWT you used to download a layer contained the user_id claim, that value is stored on disk. Whenever you attempt to reauthenticate the document descriptor, Instant then compares the stored value to the value encoded in the new JWT, and will fail with this error if the values do not match up.

    Declaration

    Objective-C

    PSPDFInstantErrorUserIDMismatch = 33

    Swift

    case userIDMismatch = 33