added packet size configuration to client config files

This commit is contained in:
Jędrzej Stuczyński
2023-03-20 17:29:43 +00:00
parent 84c1679973
commit cc6017db3b
11 changed files with 82 additions and 2 deletions
+5
View File
@@ -94,6 +94,11 @@ impl Config {
}
}
pub fn validate(&self) -> bool {
// no other sections have explicit requirements (yet)
self.base.validate()
}
pub fn with_socket(mut self, socket_type: SocketType) -> Self {
self.socket.socket_type = socket_type;
self
+4
View File
@@ -112,6 +112,10 @@ pub(crate) async fn execute(args: &Run) -> Result<(), Box<dyn Error + Send + Syn
}
};
if !config.validate() {
return Err(Box::new(ClientError::ConfigValidationFailure))
}
let override_config_fields = OverrideConfig::from(args.clone());
config = override_config(config, override_config_fields);
+4
View File
@@ -11,6 +11,10 @@ pub enum ClientError {
#[error("Failed to load config for: {0}")]
FailedToLoadConfig(String),
// TODO: add more details here
#[error("Failed to validate the loaded config")]
ConfigValidationFailure,
#[error("Failed local version check, client and config mismatch")]
FailedLocalVersionCheck,