Add new test for invalid TLS configuration

This commit is contained in:
2022-09-02 10:18:20 +02:00
parent 40c1bfc938
commit 54214a3308
9 changed files with 181 additions and 21 deletions

View File

@ -1,7 +1,12 @@
use std::error::Error;
use std::fmt::Display;
use std::io::ErrorKind;
/// Encapsulate errors in [`std::io::Error`] with a message
pub fn encpasulate_error<E: Error>(e: E, msg: &str) -> std::io::Error {
pub fn encpasulate_error<E: Display>(e: E, msg: &str) -> std::io::Error {
std::io::Error::new(ErrorKind::Other, format!("{}: {}", msg, e))
}
/// Create a new [`std::io::Error`]
pub fn new_err(msg: &str) -> std::io::Error {
std::io::Error::new(ErrorKind::Other, msg.to_string())
}