Improved error handling (part 1)

This commit is contained in:
mdecimus
2024-07-11 18:44:51 +02:00
parent ea77a98260
commit 0c2a3f09fe
179 changed files with 3409 additions and 3048 deletions

View File

@@ -19,7 +19,7 @@ impl JMAP {
pub async fn sieve_script_query(
&self,
mut request: QueryRequest<RequestArguments>,
) -> Result<QueryResponse, MethodError> {
) -> trc::Result<QueryResponse> {
let account_id = request.account_id.document_id();
let mut filters = Vec::with_capacity(request.filter.len());
@@ -32,7 +32,7 @@ impl JMAP {
Filter::And | Filter::Or | Filter::Not | Filter::Close => {
filters.push(cond.into());
}
other => return Err(MethodError::UnsupportedFilter(other.to_string())),
other => return Err(MethodError::UnsupportedFilter(other.to_string()).into()),
}
}
@@ -57,7 +57,7 @@ impl JMAP {
SortProperty::IsActive => {
query::Comparator::field(Property::IsActive, comparator.is_ascending)
}
other => return Err(MethodError::UnsupportedSort(other.to_string())),
other => return Err(MethodError::UnsupportedSort(other.to_string()).into()),
});
}