mirror of
https://github.com/alterware/alterware-launcher.git
synced 2025-12-04 07:17:50 +00:00
improve logging of http errors
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use std::{fs, path::PathBuf};
|
||||
|
||||
use colored::Colorize;
|
||||
|
||||
pub fn get_file_sha1(path: &PathBuf) -> String {
|
||||
let mut sha1 = sha1_smol::Sha1::new();
|
||||
sha1.update(&fs::read(path).unwrap());
|
||||
@@ -18,3 +20,9 @@ pub fn rev_to_int(rev: &str) -> u16 {
|
||||
.parse::<u16>()
|
||||
.unwrap_or(0)
|
||||
}
|
||||
|
||||
pub fn fatal_error(error: &str) {
|
||||
println!("\n\n{}:\n{}", "Error".bright_red(), error);
|
||||
stdin();
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user