From 8b7684c0a77fedb40a943e59f99f3969f1e11ce7 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 17 Nov 2020 22:31:33 -0800 Subject: [PATCH] + Fixed issue with /channels/delete return 200 on db-lib failure --- server-api/src/channels.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server-api/src/channels.rs b/server-api/src/channels.rs index d5be622..d27ed2a 100644 --- a/server-api/src/channels.rs +++ b/server-api/src/channels.rs @@ -78,8 +78,14 @@ pub async fn delete_channel(pool: &Pool, response: &mut Response, params: // TODO: something more intelligent with the logging im ngl match Channel::delete(pool, id).await { db::Response::Success => {}, - db::Response::Other(data) => println!("\t{}", data), - _ => {} + db::Response::Other(data) => { + eprintln!("\t{}", data); + *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; + } + _ => { + eprintln!("\tBro like restart the server"); + *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; + } } } else {