Fix example config and an unwrap in main()
Was panicking on missing cert file. Oops. Now prints an error like it should
This commit is contained in:
@@ -19,5 +19,5 @@ admins = []
|
||||
url = "my.db.server"
|
||||
user = "confetti"
|
||||
password = "my_secret_password"
|
||||
db = "confetti"
|
||||
db_name = "confetti"
|
||||
num_connections = 8
|
||||
|
||||
+17
-4
@@ -112,10 +112,23 @@ async fn main() -> ExitCode {
|
||||
|
||||
|
||||
// Read certificate file
|
||||
let certs = CertificateDer::pem_file_iter(&config.certfile)
|
||||
.unwrap()
|
||||
.map(|cert| cert.unwrap())
|
||||
.collect();
|
||||
debug!("Reading certificate file");
|
||||
let certs = match CertificateDer::pem_file_iter(&config.certfile) {
|
||||
Ok(certs) => match certs.collect::<Result<Vec<_>,_>>() {
|
||||
Ok(k) => k,
|
||||
Err(e) => {
|
||||
error!("Could not read certificates.");
|
||||
error!("{}",e);
|
||||
return ExitCode::FAILURE
|
||||
}
|
||||
|
||||
},
|
||||
Err(e) => {
|
||||
error!("Could not read certificates.");
|
||||
error!("{}",e);
|
||||
return ExitCode::FAILURE
|
||||
}
|
||||
};
|
||||
let key = PrivateKeyDer::from_pem_file(&config.keyfile).unwrap();
|
||||
|
||||
let address = match IpAddr::from_str(&config.listen_address) {
|
||||
|
||||
Reference in New Issue
Block a user