mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-11-12 06:40:55 +08:00
Provide error details when failing to obtain modseq
This commit is contained in:
parent
af199e2b37
commit
4bf191f06b
1 changed files with 12 additions and 10 deletions
|
|
@ -215,7 +215,7 @@ impl<T: SessionStream> SessionData<T> {
|
||||||
|
|
||||||
pub async fn get_modseq(&self, account_id: u32) -> crate::op::Result<Option<u64>> {
|
pub async fn get_modseq(&self, account_id: u32) -> crate::op::Result<Option<u64>> {
|
||||||
// Obtain current modseq
|
// Obtain current modseq
|
||||||
if let Ok(modseq) = self
|
match self
|
||||||
.jmap
|
.jmap
|
||||||
.core
|
.core
|
||||||
.storage
|
.storage
|
||||||
|
|
@ -223,15 +223,17 @@ impl<T: SessionStream> SessionData<T> {
|
||||||
.get_last_change_id(account_id, Collection::Email)
|
.get_last_change_id(account_id, Collection::Email)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(modseq)
|
Ok(modseq) => Ok(modseq),
|
||||||
} else {
|
Err(err) => {
|
||||||
tracing::error!(parent: &self.span,
|
tracing::error!(parent: &self.span,
|
||||||
event = "error",
|
event = "error",
|
||||||
context = "store",
|
context = "store",
|
||||||
account_id = account_id,
|
account_id = account_id,
|
||||||
collection = ?Collection::Email,
|
collection = ?Collection::Email,
|
||||||
"Failed to obtain modseq");
|
reason = ?err,
|
||||||
Err(StatusResponse::database_failure())
|
"Failed to obtain modseq");
|
||||||
|
Err(StatusResponse::database_failure())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue