Skip to content

Commit c2e8592

Browse files
mgoldenbergHywan
authored andcommitted
refactor(indexeddb): add enum for general IndexedDB serialization errors
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
1 parent 3b84b2c commit c2e8592

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/matrix-sdk-indexeddb/src/crypto_store/indexeddb_serializer.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ pub struct IndexeddbSerializer {
3939
store_cipher: Option<Arc<StoreCipher>>,
4040
}
4141

42+
#[allow(dead_code)]
43+
#[derive(Debug, thiserror::Error)]
44+
pub enum IndexeddbSerializerError {
45+
#[error(transparent)]
46+
Serialization(#[from] serde_json::Error),
47+
#[error("DomException {name} ({code}): {message}")]
48+
DomException {
49+
/// DomException code
50+
code: u16,
51+
/// Specific name of the DomException
52+
name: String,
53+
/// Message given to the DomException
54+
message: String,
55+
},
56+
#[error(transparent)]
57+
CryptoStoreError(#[from] CryptoStoreError),
58+
}
59+
4260
#[derive(Debug, Deserialize, Serialize)]
4361
#[serde(untagged)]
4462
pub enum MaybeEncrypted {

0 commit comments

Comments
 (0)