Skip to content

Commit

Permalink
cli: add error cause for TCP server's app_loop
Browse files Browse the repository at this point in the history
If there is an error when running as a TCP server (for instance
a fatal formatting error on the stream), then the CLI will log
the error, close the connection and continue listening for more
TCP connections. This adds the cause of the error to the log,
using Anyhow's Error alternate formatting.

Signed-off-by: Daniel Estévez <[email protected]>
  • Loading branch information
daniestevez committed Oct 2, 2023
1 parent c99d7a8 commit 0cdab76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Do not fail if a packet cannot be written to the TUN.
- Add cause when logging errors for the TCP server.

## [0.4.1] - 2023-09-29

Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub fn main() -> Result<()> {
}
app.bbframe_recv = Some(BBFrameStream::new(stream));
if let Err(err) = app.app_loop() {
log::error!("error; waiting for another client: {err}");
log::error!("error; waiting for another client: {err:#}");
}
}
}
Expand Down

0 comments on commit 0cdab76

Please sign in to comment.