refactor(indexeddb): add enum for general IndexedDB serialization errors

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
This commit is contained in:
Michael Goldenberg
2025-05-01 11:43:20 -04:00
committed by Ivan Enderlin
parent 3b84b2c5e7
commit c2e859273d

View File

@@ -39,6 +39,24 @@ pub struct IndexeddbSerializer {
store_cipher: Option<Arc<StoreCipher>>,
}
#[allow(dead_code)]
#[derive(Debug, thiserror::Error)]
pub enum IndexeddbSerializerError {
#[error(transparent)]
Serialization(#[from] serde_json::Error),
#[error("DomException {name} ({code}): {message}")]
DomException {
/// DomException code
code: u16,
/// Specific name of the DomException
name: String,
/// Message given to the DomException
message: String,
},
#[error(transparent)]
CryptoStoreError(#[from] CryptoStoreError),
}
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
pub enum MaybeEncrypted {