Skip to content

Commit fdaa7cb

Browse files
authored
fix: error print (#51)
1 parent 59e4fcd commit fdaa7cb

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/main.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ async fn server_run() -> Result<(), Box<dyn Error>> {
5151
break
5252
}
5353

54-
let tuples = db.run(&input).await?;
55-
56-
if tuples.is_empty() {
57-
println!("\nEmpty!");
58-
} else {
59-
println!("\n{}", create_table(&tuples));
54+
match db.run(&input).await {
55+
Ok(tuples) => {
56+
if tuples.is_empty() {
57+
println!("\nEmpty!");
58+
} else {
59+
println!("\n{}", create_table(&tuples));
60+
}
61+
}
62+
Err(err) => {
63+
println!("{}", err);
64+
}
6065
}
6166
}
6267

0 commit comments

Comments
 (0)