mirror of
https://github.com/Syfaro/fuzzysearch.git
synced 2024-11-10 17:02:38 +00:00
Log rejections.
This commit is contained in:
parent
b4b441139b
commit
70b94f454b
@ -1,7 +1,7 @@
|
|||||||
use crate::types::*;
|
use crate::types::*;
|
||||||
use crate::utils::{extract_e621_rows, extract_fa_rows};
|
use crate::utils::{extract_e621_rows, extract_fa_rows};
|
||||||
use crate::{rate_limit, Pool};
|
use crate::{rate_limit, Pool};
|
||||||
use log::debug;
|
use log::{info, debug};
|
||||||
use warp::{reject, Rejection, Reply};
|
use warp::{reject, Rejection, Reply};
|
||||||
|
|
||||||
fn map_bb8_err(err: bb8::RunError<tokio_postgres::Error>) -> Rejection {
|
fn map_bb8_err(err: bb8::RunError<tokio_postgres::Error>) -> Rejection {
|
||||||
@ -207,6 +207,8 @@ pub async fn search_file(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn handle_rejection(err: Rejection) -> Result<impl Reply, std::convert::Infallible> {
|
pub async fn handle_rejection(err: Rejection) -> Result<impl Reply, std::convert::Infallible> {
|
||||||
|
info!("Had rejection: {:?}", err);
|
||||||
|
|
||||||
let (code, message) = if err.is_not_found() {
|
let (code, message) = if err.is_not_found() {
|
||||||
(
|
(
|
||||||
warp::http::StatusCode::NOT_FOUND,
|
warp::http::StatusCode::NOT_FOUND,
|
||||||
|
Loading…
Reference in New Issue
Block a user