more error logging

This commit is contained in:
Snorre 2025-03-25 11:46:48 +01:00
parent 11925f8c4f
commit 5c556a0803

View file

@ -208,10 +208,10 @@ fn handle_connection(mut stream: TcpStream) {
.reduce(|a, b| format!("{}\n{}", b, a))
.unwrap()
}
// .reduce(|i, x| format!("{}\n{}", i, x))
// .unwrap()
// .to_string(),
Err(e) => format!("HTTP/1.1 500\r\n\r\n{}", e),
Err(e) => {
eprintln!("\x1b[0;31mError when fetching list of posts: {e:?}\x1b[0m");
format!("HTTP/1.1 500\r\n\r\n{}", e)
},
}
}
.as_bytes(),