mirror of
https://github.com/artegoser/ONLang
synced 2024-11-05 20:43:57 +03:00
Custom panic
This commit is contained in:
parent
b0a29f9041
commit
4ce6784b08
1 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,15 @@ mod interpreter;
|
|||
use interpreter::Interpreter;
|
||||
|
||||
fn main() {
|
||||
std::panic::set_hook(
|
||||
box |info| {
|
||||
eprint!("{msg}", msg = match info.message() {
|
||||
None => "Program panicked!".to_owned(),
|
||||
Some(x) => x.to_string()
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
let start = Instant::now();
|
||||
|
||||
let args = Args::parse();
|
||||
|
|
Loading…
Reference in a new issue