Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#417 Added additional error logging to front end handle_request function. #464

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ This file aims to acknowledge the specific contributors referred to in the "Cont
* Patrick Uiterwijk (@puiterwijk)
* Nicolas Stalder (@nickray)
* Edmund Grimley Evans (@egrimley-arm)
* Matt Davis (@MattDavis00)
7 changes: 5 additions & 2 deletions src/front/front_end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ impl FrontEndHandler {
/// Unmarshalls a request from the stream, passes it to the dispatcher and marshalls
/// the response back onto the stream.
///
/// If an error occurs during (un)marshalling, no operation will be performed and the
/// method will return.
/// If an error occurs during (un)marshalling; no operation will be performed, an error will be logged
/// and the method will return.
pub fn handle_request(&self, mut connection: Connection) {
trace!("handle_request ingress");
// Read bytes from stream
Expand All @@ -50,6 +50,9 @@ impl FrontEndHandler {
format_error!("Failed to read request", status);

let response = Response::from_status(status);
if response.header.status != ResponseStatus::Success {
format_error!("Sending back an error", response.header.status);
}
if let Err(status) = response.write_to_stream(&mut connection.stream) {
format_error!("Failed to write response", status);
}
Expand Down