refactor: use error macro

This commit is contained in:
Compositr 2024-11-18 14:20:51 +11:00
parent 794a2f8f7e
commit f4b4d6a02d
Signed by: compositr
GPG key ID: 91E3DE20129A0B4A

View file

@ -1,9 +1,8 @@
use crate::{
http::{
error, http::{
requests::{Request, RequestStatus, Url},
responses::{Body, Response, UnitOrBoxedError},
},
threads::ThreadPool,
}, threads::ThreadPool
};
use std::{
collections::HashMap,
@ -65,7 +64,7 @@ impl Handlers {
RequestStatus::Ok(req) => req,
RequestStatus::MalformedHTTP(stream) => {
stream.shutdown(Shutdown::Both).unwrap_or_else(|_| {
eprintln!("Failed to close malformed HTTP stream")
error!("Failed to shutdown malformed HTTP stream")
});
continue;
}