UNPKG

@signiant/media-shuttle-sdk-base

Version:

The base parent sdk behind other media shuttle sdks (e.g. media-shuttle-sdk)

134 lines (133 loc) 5.21 kB
/** * This enum represents the various caller facing errors the application may throw. Implementations may * optionally catch {@link CodedError} objects and define control behaviour on the basis of a specific error. */ var ErrorCode; (function (ErrorCode) { //Issues an SDK caller might see (Platform Frontend, User GUI, etc.) /** * The User canceled folder selection on download. */ ErrorCode["FOLDER_SELECTION_CANCELED"] = "folder.selection.canceled"; /** * There was an unknown error during folder selection. */ ErrorCode["FOLDER_SELECTION_ERROR"] = "folder.selection.error"; /** * There was a timeout when attempting to connect to the Signiant app. * * Root causes could include: * * The app has not been installed. * * The app was installed but the user did not authorize the launch in the required time. * * Network connectivity issues. */ ErrorCode["APP_CONNECTION_TIMEOUT"] = "app.connection.timeout"; /** * Error thrown when the app may not be installed. This happens the first time the SDK is used but can * be overwritten with the force flag when generating a transfer. */ ErrorCode["APP_MAY_NOT_BE_INSTALLED"] = "app.may.not.be.installed"; /** * The input does not conform to the expected logger format. * * Null loggers are not allowed, If you wish to disable all logging consider turning the log level of the * default logger to OFF. */ ErrorCode["LOGGER_INVALID"] = "logger.invalid"; /** * An event dispatched by the Signiant app was unknown. * * This might represent a mismatch between the SDK version and the Signiant app version. */ ErrorCode["UNKNOWN_EVENT_TYPE"] = "error.type.unknown"; /** * Unknown problem while launching the Signiant App. */ ErrorCode["ERROR_LAUNCHING_APP"] = "error.launching.app"; //Issues a customer shouldn't see. /** * The Signiant app connection was not initialized for an operation that requires the app. * * App initialization should be done automatically when a download is generated. */ ErrorCode["APP_CONNECTION_UNINITIALIZED"] = "app.connection.uninitialized"; /** * A folder was not selected by a user. * * A user should be prompted for a destination folder automatically when a transfer is created. */ ErrorCode["FOLDER_NOT_SELECTED"] = "folder.not.selected"; /** * State transition is not valid. * * Examples of this error include but are not limited to: * * Attempting to start a transfer that has already been started. * * Attempting to retry a transfer before a transfer was started. */ ErrorCode["STATE_TRANSITION_INVALID"] = "invalid.state.transition"; /** * Operation not supported. */ ErrorCode["UNSUPPORTED_OPERATION"] = "unsupported.operation"; /** * Currently only download operations are supported. */ ErrorCode["UNSUPPORTED_TRANSFER_DIRECTION"] = "transfer.unsupported.direction"; /** * Websocket connection timed out after fixed interval. */ ErrorCode["WEBSOCKET_CONNECTION_TIMEOUT"] = "websocket.connection.timeout"; /** * An unknown error occurred while initializing the websocket. */ ErrorCode["WEBSOCKET_INITIALIZATION_ERROR"] = "websocket.initialization.error"; /** * Error while trying to encrypt message to publish. */ ErrorCode["ENCRYPTION_ERROR"] = "encryption.error"; /** * Error while trying to decrypt message received. */ ErrorCode["DECRYPTION_ERROR"] = "decryption.error"; /** * There was no recognized provided in the relevant messaging config. */ ErrorCode["NO_PROVIDER_ERROR"] = "no.provider.error"; /** * The user is not a member of the portal. */ ErrorCode["PORTAL_MEMBER_NOT_FOUND"] = "portal.member.not.found"; /** * The user does not have permission to download one or more of the specified files. */ ErrorCode["FILE_PERMISSIONS_DENIED"] = "file.permissions.denied"; /** * The user does not have any member permissions on the portal. */ ErrorCode["USER_PERMISSIONS_NOT_SET"] = "user.permissions.not.set"; /** * The user cancels the file selection cancelled */ ErrorCode["FILE_SELECTION_CANCELLED"] = "files.selection.canceled"; /** * There was an error in the file selection */ ErrorCode["FILE_SELECTION_ERROR"] = "files.selection.error"; /** * Error code when attempting to start a transfer without the Transfer Config */ ErrorCode["TRANSFER_CONFIG_NOT_FOUND"] = "transfer.config.not.found"; /** * Error code when attempting to start a transfer without the destination */ ErrorCode["TRANSFER_DESTINATION_MISSING_ERROR"] = "transfer.destination.not.found"; /** * Error code when trying to start an upload without selected files */ ErrorCode["UPLOAD_NO_FILES_SELECTED"] = "upload.no.files.selected"; /** * Used when request timeouts */ ErrorCode["REQUEST_TIMEOUT"] = "request.timeout"; })(ErrorCode || (ErrorCode = {})); export default ErrorCode;