File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
crates/matrix-sdk-indexeddb/src/crypto_store Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ pub struct IndexeddbSerializer {
3939 store_cipher : Option < Arc < StoreCipher > > ,
4040}
4141
42- #[ allow( dead_code) ]
4342#[ derive( Debug , thiserror:: Error ) ]
4443pub enum IndexeddbSerializerError {
4544 #[ error( transparent) ]
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ use async_trait::async_trait;
2121use gloo_utils:: format:: JsValueSerdeExt ;
2222use hkdf:: Hkdf ;
2323use indexed_db_futures:: prelude:: * ;
24+ use indexeddb_serializer:: IndexeddbSerializerError ;
2425use js_sys:: Array ;
2526use matrix_sdk_crypto:: {
2627 olm:: {
@@ -148,6 +149,20 @@ pub enum IndexeddbCryptoStoreError {
148149 SchemaTooNewError { max_supported_version : u32 , current_version : u32 } ,
149150}
150151
152+ impl From < IndexeddbSerializerError > for IndexeddbCryptoStoreError {
153+ fn from ( value : IndexeddbSerializerError ) -> Self {
154+ match value {
155+ IndexeddbSerializerError :: Serialization ( error) => Self :: Serialization ( error) ,
156+ IndexeddbSerializerError :: DomException { code, name, message } => {
157+ Self :: DomException { code, name, message }
158+ }
159+ IndexeddbSerializerError :: CryptoStoreError ( crypto_store_error) => {
160+ Self :: CryptoStoreError ( crypto_store_error)
161+ }
162+ }
163+ }
164+ }
165+
151166impl From < web_sys:: DomException > for IndexeddbCryptoStoreError {
152167 fn from ( frm : web_sys:: DomException ) -> IndexeddbCryptoStoreError {
153168 IndexeddbCryptoStoreError :: DomException {
You can’t perform that action at this time.
0 commit comments