Files
tubestation/browser/components/backup/BackupConstants.mjs
Stephen Thompson 0bdfadda55 Bug 1904949 - Add cause error codes to backup service r=backup-reviewers,mconley
This introduces error code causes that can be used by UI components to present context-relevant error text. This starts throwing errors with cause error codes in parts of the backup codebase, but there are still areas (especially at the boundary with web workers) where cause codes need to be introduced and handled.

Differential Revision: https://phabricator.services.mozilla.com/D215535
2024-07-04 14:03:21 +00:00

40 lines
1.4 KiB
JavaScript

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
export const ERRORS = Object.freeze({
/** User is not authorized to restore a backup archive */
UNAUTHORIZED: 1,
/** Selected backup archive can't be restored because it is corrupt */
CORRUPTED_ARCHIVE: 2,
/**
* Selected backup archive can't be restored because the backup manifest
* version is too old, from the future, or invalid
*/
UNSUPPORTED_BACKUP_VERSION: 3,
/** Backup service was not started or is not running */
UNINITIALIZED: 4,
/** Could not read from or write to the file system */
FILE_SYSTEM_ERROR: 5,
/** Encryption of backup archive failed */
ENCRYPTION_FAILED: 6,
/** Decryption of backup archive failed */
DECRYPTION_FAILED: 7,
/** Recovery of backup failed without a more specific cause */
RECOVERY_FAILED: 8,
/** Unknown error with backup system without a more specific cause */
UNKNOWN: 9,
/**
* Backup system tried to enable backup encryption but it was
* already enabled
*/
ENCRYPTION_ALREADY_ENABLED: 10,
/**
* Backup system tried to disable backup encryption but it was
* already disabled
*/
ENCRYPTION_ALREADY_DISABLED: 10,
/** User supplied a new password that is not a valid password */
INVALID_PASSWORD: 12,
});