crypto: Expose the crypto store error pulicly
parent
f6f382e28a
commit
c5241af675
|
@ -20,7 +20,7 @@ use std::io::Error as IoError;
|
|||
use thiserror::Error;
|
||||
|
||||
#[cfg(feature = "encryption")]
|
||||
use matrix_sdk_crypto::{MegolmError, OlmError};
|
||||
use matrix_sdk_crypto::{CryptoStoreError, MegolmError, OlmError};
|
||||
|
||||
/// Result type of the rust-sdk.
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
@ -45,6 +45,12 @@ pub enum Error {
|
|||
#[error(transparent)]
|
||||
IoError(#[from] IoError),
|
||||
|
||||
/// An error occurred in the crypto store.
|
||||
#[cfg(feature = "encryption")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(encryption)))]
|
||||
#[error(transparent)]
|
||||
CryptoStore(#[from] CryptoStoreError),
|
||||
|
||||
/// An error occurred during a E2EE operation.
|
||||
#[cfg(feature = "encryption")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(encryption)))]
|
||||
|
|
|
@ -54,4 +54,5 @@ pub use requests::{
|
|||
IncomingResponse, KeysQueryRequest, OutgoingRequest, OutgoingRequests,
|
||||
OutgoingVerificationRequest, RoomMessageRequest, ToDeviceRequest,
|
||||
};
|
||||
pub use store::CryptoStoreError;
|
||||
pub use verification::{Sas, VerificationRequest};
|
||||
|
|
|
@ -504,7 +504,7 @@ impl OlmMachine {
|
|||
pub async fn get_missing_sessions(
|
||||
&self,
|
||||
users: impl Iterator<Item = &UserId>,
|
||||
) -> OlmResult<Option<(Uuid, KeysClaimRequest)>> {
|
||||
) -> StoreResult<Option<(Uuid, KeysClaimRequest)>> {
|
||||
self.session_manager.get_missing_sessions(users).await
|
||||
}
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ impl SessionManager {
|
|||
pub async fn get_missing_sessions(
|
||||
&self,
|
||||
users: impl Iterator<Item = &UserId>,
|
||||
) -> OlmResult<Option<(Uuid, KeysClaimRequest)>> {
|
||||
) -> StoreResult<Option<(Uuid, KeysClaimRequest)>> {
|
||||
let mut missing = BTreeMap::new();
|
||||
|
||||
// Add the list of devices that the user wishes to establish sessions
|
||||
|
|
Loading…
Reference in New Issue