StringFormatting(#[from] fmt::Error),
#[error("JSON deserialisation error: {0:?}")]
JSONEncode(serde_json::Error),
- #[error("Server error: {}", AnyhowFormat(&.0))]
+ #[error("Server error: {}", .0.d())]
Anyhow(#[from] anyhow::Error),
#[error("Game contains only partial data for player, or account missing")]
PartialPlayerData,
impl From<anyhow::Error> for AuthKeysManipError {
fn from(ae: anyhow::Error) -> AuthKeysManipError {
error!("authorized_keys manipulation error: {}: {}",
- &config().authorized_keys, AnyhowFormat(&ae));
+ &config().authorized_keys, ae.d());
AuthKeysManipError { }
}
}
}
#[derive(Debug)]
-pub struct AnyhowFormat<'a>(pub &'a anyhow::Error);
-impl Display for AnyhowFormat<'_> {
+pub struct AnyhowDisplay<'a>(pub &'a anyhow::Error);
+impl Display for AnyhowDisplay<'_> {
#[throws(fmt::Error)]
fn fmt(&self, f: &mut fmt::Formatter) {
let mut delim = "";
Ok(())
}
+ fn d(&self) -> AnyhowDisplay<'_> { AnyhowDisplay(self) }
+
fn end_process(self, estatus: u8) -> ! {
#[derive(Default,Debug)] struct Sol { any: bool }
impl Sol {