// Author: cirakg & claude ai // Summary: The one exception type the storage layer throws, with a code the UI turns into a message. import Toybox.Lang; class VaultError extends Lang.Exception { // The session is locked and the operation needs the master key. static const LOCKED = 1; // A record or the PIN wrap failed to decode or verify. static const DAMAGED = 2; // Application.Storage refused a write (store full). static const FULL = 3; // The entry cap is reached, or one record would be too big. static const LIMIT = 4; // No entry with that ID. static const NOT_FOUND = 5; // The data was written by a newer app version; nothing may be changed. static const NEWER_SCHEMA = 6; // The entry failed validation (see Entry.validate()). static const INVALID = 7; // A wrong-PIN delay is running; try again later. static const LOCKED_OUT = 8; // The operation needs a PIN and none is set, or a PIN is already set. static const NO_PIN = 9; static const PIN_EXISTS = 10; var code as Number; function initialize(errorCode as Number, message as String) { Exception.initialize(); code = errorCode; mMessage = message; } }