Skip to content

Commit

Permalink
Add validation of location determination config
Browse files Browse the repository at this point in the history
  • Loading branch information
jgallagher committed Apr 21, 2022
1 parent 1ba01ae commit 674ffc2
Show file tree
Hide file tree
Showing 3 changed files with 323 additions and 53 deletions.
15 changes: 8 additions & 7 deletions gateway-sp-comms/src/communicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,14 @@ impl Communicator {
let sp =
self.switch.sp_socket(port).expect("lost address of attached SP");

Ok(self.request_response(
&sp,
RequestKind::SerialConsoleWrite(packet),
ResponseKindExt::try_into_serial_console_write_ack,
Some(timeout),
)
.await?)
Ok(self
.request_response(
&sp,
RequestKind::SerialConsoleWrite(packet),
ResponseKindExt::try_into_serial_console_write_ack,
Some(timeout),
)
.await?)
}

/// Get the state of a given SP.
Expand Down
4 changes: 2 additions & 2 deletions gateway-sp-comms/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use thiserror::Error;
pub enum StartupError {
#[error("error binding to UDP address {addr}: {err}")]
UdpBind { addr: SocketAddr, err: io::Error },
#[error("invalid configuration file: {reason}")]
InvalidConfig { reason: String },
#[error("invalid configuration file: {}", .reasons.join(", "))]
InvalidConfig { reasons: Vec<String> },
#[error("error communicating with SP: {0}")]
SpCommunicationFailed(#[from] SpCommunicationError),
#[error("location discovery failed: {reason}")]
Expand Down
Loading

0 comments on commit 674ffc2

Please sign in to comment.