public final enum

InstantErrorCode

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ com.pspdfkit.instant.exceptions.InstantErrorCode

Class Overview

Code used inside InstantException to indicate instant error source.

Summary

Enum Values
InstantErrorCode  ALREADY_SYNCING  A new sync request has not been initiated because there already was one running. 
InstantErrorCode  ATTACHMENT_ALREADY_TRANSFERRED  Internal error code — if you ever see this reported, please file a bug. 
InstantErrorCode  ATTACHMENT_NOT_LOADED  An attachment with the given ID does not exist in the disk cache. 
InstantErrorCode  ATTACHMENT_TRANSFER_IN_PROGRESS  Internal error code — if you ever see this reported, please file a bug. 
InstantErrorCode  AUTHENTICATION_FAILED  The process could not be completed because the authentication failed. 
InstantErrorCode  DATABASE_ERROR  The data could not be written to the instant database. 
InstantErrorCode  INVALID_JWT  The given string is not a valid Instant JWT. 
InstantErrorCode  INVALID_REQUEST  The server rejected our request for a reason other than an authentication failure. 
InstantErrorCode  INVALID_SERVER_DATA  The data from the server has been ignored because it was invalid. 
InstantErrorCode  NO_SUCH_ATTACHMENT  There is no attachment with the specified ID. 
InstantErrorCode  NO_SUCH_ATTACHMENT_TRANSFER  Internal error code — if you ever see this reported, please file a bug. 
InstantErrorCode  OLD_CLIENT  The operation could not be completed because the client and server have incompatible versions: the server expects a newer client. 
InstantErrorCode  OLD_SERVER  The operation could not be completed because the client and server have incompatible versions: the client is too new for the server. 
InstantErrorCode  READ_FAILED  Reading from the filesystem failed. 
InstantErrorCode  REQUEST_FAILED  The request did not complete due to some networking problem. 
InstantErrorCode  SERVER_UUID_PENDING  The server cache could not be looked up because the server’s UUID is yet to be determined. 
InstantErrorCode  UNKNOWN  We don’t really know what happened. 
InstantErrorCode  USER_CANCELLED  The operation failed, because it has been cancelled. 
InstantErrorCode  USER_MISMATCH  The specified user Id is incompatible with the value stored on disk. 
InstantErrorCode  WRITE_FAILED  The loaded data could not be written to disk. 
Public Methods
static InstantErrorCode valueOf(String name)
final static InstantErrorCode[] values()
[Expand]
Inherited Methods
From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum Values

public static final InstantErrorCode ALREADY_SYNCING

A new sync request has not been initiated because there already was one running.

public static final InstantErrorCode ATTACHMENT_ALREADY_TRANSFERRED

Internal error code — if you ever see this reported, please file a bug.

public static final InstantErrorCode ATTACHMENT_NOT_LOADED

An attachment with the given ID does not exist in the disk cache.

To find out whether or not the attachment actually exists, try downloading it from the server.

public static final InstantErrorCode ATTACHMENT_TRANSFER_IN_PROGRESS

Internal error code — if you ever see this reported, please file a bug.

public static final InstantErrorCode AUTHENTICATION_FAILED

The process could not be completed because the authentication failed.

This typically means either the user no longer has access to the document or the authentication token (JWT) expired. Your own server should be able to say if the user still has access. If the user still has access, obtain a new authentication token from your server and call reauthenticateWithJwtAsync(String) on your document. If the user no longer has access, stop showing this document to the user.

Note that the document’s storage will not be removed from disk! You can still access that document, and even continue to make edits to it. These will, however, not be synced anymore.

You need to obtain a new authentication token, and retry your operation. Until then, anything that would hit the instant server will fail again.

public static final InstantErrorCode DATABASE_ERROR

The data could not be written to the instant database. Any other interactions with the database are likely to fail, too. If the problem persists across restarts of the app, remove this document’s local storage, and start anew.

Note: More details can be found in the underlying error InstantException#getUnderlyingError(), which will be the integer SQLite error code.

public static final InstantErrorCode INVALID_JWT

The given string is not a valid Instant JWT. It is either malformed or missing mandatory claims.

public static final InstantErrorCode INVALID_REQUEST

The server rejected our request for a reason other than an authentication failure.

If you ever see this error, please contact support..

public static final InstantErrorCode INVALID_SERVER_DATA

The data from the server has been ignored because it was invalid.

If you ever see this error, please contact support..

public static final InstantErrorCode NO_SUCH_ATTACHMENT

There is no attachment with the specified ID.

A download request for the attachment with the given ID has been rejected by the server because it does not know of such an attachment.

public static final InstantErrorCode NO_SUCH_ATTACHMENT_TRANSFER

Internal error code — if you ever see this reported, please file a bug.

public static final InstantErrorCode OLD_CLIENT

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.

public static final InstantErrorCode OLD_SERVER

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.

public static final InstantErrorCode READ_FAILED

Reading from the filesystem failed. This can happen if the filesystem structure of the disk cache has been modified unexpectedly.

public static final InstantErrorCode REQUEST_FAILED

The request did not complete due to some networking problem. Most likely, the connection was interrupted.

Note: More details can be found in the underlying error InstantException#getUnderlyingError(), which will be the integer representation of a HTTP error.

public static final InstantErrorCode SERVER_UUID_PENDING

The server cache could not be looked up because the server’s UUID is yet to be determined. This happens for every InstantClient in a newly installed app until it has authenticated for loading the first document.

public static final InstantErrorCode UNKNOWN

We don’t really know what happened.

public static final InstantErrorCode USER_CANCELLED

The operation failed, because it has been cancelled.

public static final InstantErrorCode USER_MISMATCH

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 re-authenticate 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.

public static final InstantErrorCode WRITE_FAILED

The loaded data could not be written to disk. This can happen simply because the disk is full.

Public Methods

public static InstantErrorCode valueOf (String name)

public static final InstantErrorCode[] values ()