better print on err

This commit is contained in:
Dominic Harris 2022-02-28 17:45:36 -05:00
parent d293e59d4d
commit 7f5e51d836
No known key found for this signature in database
GPG Key ID: 93CCF85F3E2A4F65
1 changed files with 4 additions and 1 deletions

View File

@ -63,6 +63,8 @@ async fn get_paste(state: web::Data<AppState>, id: web::Path<String>) -> impl Re
});
}
_ => {
eprintln!("Error occurred while getting paste: {:?}", e);
return HttpResponse::InternalServerError().json(ApiResponse {
success: false,
data: ApiError {
@ -116,7 +118,8 @@ async fn new_paste(state: web::Data<AppState>, data: web::Json<PartialPaste>) ->
});
}
Err(e) => {
println!("{}", e);
eprintln!("Error occurred while creating paste: {:?}", e);
return HttpResponse::InternalServerError().json(ApiResponse {
success: false,
data: ApiError {