Closed Bug 1904950 Opened 5 months ago Closed 5 months ago

Have the "Unauthorized" exception provide a numeric "cause" to indicate what occurred when failing to decrypt a backup

Categories

(Firefox :: Profile Backup, task, P3)

task

Tracking

()

RESOLVED DUPLICATE of bug 1904949

People

(Reporter: mconley, Unassigned)

References

Details

(Whiteboard: [fidefe-device-migration])

Right now, we're just throwing a string in this case, "Unauthorized". We'll probably want to show a more friendly, localized error message in this case. The metabug that this bug is blocking describes the high-level thinking here, but essentially, in this bug, I think we should:

  1. Create a new module called BackupConstants.mjs (note the lack of .sys), and export ERRORS from it
  2. Those ERRORS should be a frozen mapping of codes to (for now) numbers, like this:
ERRORS: Object.freeze({
  DECRYPT_FAIL_BAD_RECOVERY_CODE: 1,
});

and then when throwing the "Unauthorized" exception, have the handler import BackupConstants.mjs, and do any matching there. We should make sure any handlers that do this use some kind of fallback if the thrown exception has no cause, or a cause that doesn't match.

Fixed by bug 1904949.

Status: NEW → RESOLVED
Closed: 5 months ago
Duplicate of bug: 1904949
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.