diff --git a/src/main.rs b/src/main.rs index 44c974c..c80f899 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(),