Log post fetching error if it occurs during search
This commit is contained in:
parent
6d243d86e6
commit
7c58e15123
1 changed files with 9 additions and 5 deletions
|
@ -83,11 +83,15 @@ async fn search_note(
|
|||
return Ok(None);
|
||||
};
|
||||
let instance = config.instance();
|
||||
let maybe_post = if let Ok(object) = fetch_object(&instance, search_query).await {
|
||||
let post = process_note(config, db_client, object).await?;
|
||||
Some(post)
|
||||
} else {
|
||||
None
|
||||
let maybe_post = match fetch_object(&instance, search_query).await {
|
||||
Ok(object) => {
|
||||
let post = process_note(config, db_client, object).await?;
|
||||
Some(post)
|
||||
},
|
||||
Err(err) => {
|
||||
log::warn!("{}", err);
|
||||
None
|
||||
},
|
||||
};
|
||||
Ok(maybe_post)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue