Skip to content

Commit

Permalink
catalog connection error handling: avoid a copy
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Dec 15, 2023
1 parent 5ef7435 commit 8ab5ae3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nexus/server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{
collections::{HashMap, HashSet},
fmt::Write,
sync::Arc,
time::Duration,
};
Expand Down Expand Up @@ -1376,8 +1377,7 @@ pub async fn main() -> anyhow::Result<()> {
buf.put_i32(0);
buf.put(&b"FATAL"[..]);
buf.put_u8(0);
let error_message = format!("Failed to connect to catalog: {}", e);
buf.put(error_message.as_bytes());
write!(buf, "Failed to connect to catalog: {e}").ok();
buf.put_u8(0);
buf.put_u8(b'\0');

Expand Down

0 comments on commit 8ab5ae3

Please sign in to comment.