Better error messages

This commit is contained in:
Matéo Duparc 2021-11-16 19:07:18 +01:00
parent 10153f6316
commit 89be84860d
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E
4 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ fn main() -> io::Result<()> {
None => eprintln!("Invalid parameters")
}
} else {
eprintln!("Doby format not recognized.");
eprintln!("doby format not recognized.");
}
Ok(())
}

View File

@ -181,7 +181,7 @@ fn number<T: FromStr>(val: &str) -> Option<T> {
match val.parse::<T>() {
Ok(n) => Some(n),
Err(_) => {
eprintln!("Cannot parse '{}' to '{}'", val, std::any::type_name::<T>());
eprintln!("Error: '{}' is not a number", val);
None
}
}

View File

@ -21,7 +21,7 @@ impl WrappedPassword {
} else {
password.zeroize();
password_confirm.zeroize();
eprintln!("Passwords don't match");
eprintln!("Error: passwords don't match");
None
}
} else {

View File

@ -40,7 +40,7 @@ fn run() -> bool {
}
}
} else {
eprintln!("Invalid parameters")
eprintln!("Error: invalid encryption parameters")
}
}
Err(e) => eprintln!("I/O error while reading headers: {}", e)