forked from nonsensical-dev/zenyx-engine
improve error handling and add metadata
This commit is contained in:
parent
10932a1a97
commit
710c8e52bd
17 changed files with 1162 additions and 787 deletions
|
@ -1,4 +1,5 @@
|
|||
use std::error::Error;
|
||||
use std::str::FromStr;
|
||||
use std::{error::Error, path::PathBuf};
|
||||
use std::fmt::Write as FmtWrite;
|
||||
use std::mem;
|
||||
|
||||
|
@ -24,11 +25,11 @@ pub fn set_panic_hook() {
|
|||
}
|
||||
|
||||
fn process_panic(info: &std::panic::PanicHookInfo<'_>) -> Result<(), Box<dyn Error>> {
|
||||
use crate::workspace;
|
||||
|
||||
use colored::Colorize;
|
||||
use std::io::Write;
|
||||
|
||||
let log_dir = workspace::get_working_dir()?;
|
||||
let log_dir = PathBuf::from_str("./").expect("wtf, The current directory no longer exists?");
|
||||
if !log_dir.exists() {
|
||||
std::fs::create_dir_all(&log_dir)?;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue