Improved error handling (part 1)
This commit is contained in:
@@ -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()),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user