mirror of
https://github.com/modrinth/code.git
synced 2026-09-04 05:48:57 +00:00
(temp) convert search request errors into internal errors
This commit is contained in:
@@ -94,7 +94,12 @@ pub trait SearchBackend: Send + Sync {
|
|||||||
info: &SearchRequest,
|
info: &SearchRequest,
|
||||||
redis: &RedisPool,
|
redis: &RedisPool,
|
||||||
) -> Result<SearchResults, ApiError> {
|
) -> Result<SearchResults, ApiError> {
|
||||||
let mut results = self.search_for_project_raw(info).await?;
|
let mut results = self.search_for_project_raw(info).await.map_err(
|
||||||
|
|error| match error {
|
||||||
|
ApiError::Request(error) => ApiError::Internal(error),
|
||||||
|
error => error,
|
||||||
|
},
|
||||||
|
)?;
|
||||||
hydrate_search_results(&mut results.hits, redis)
|
hydrate_search_results(&mut results.hits, redis)
|
||||||
.await
|
.await
|
||||||
.map_err(ApiError::Internal)?;
|
.map_err(ApiError::Internal)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user