mirror of
https://github.com/artegoser/ONLang
synced 2024-12-23 09:33:44 +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;
|
use interpreter::Interpreter;
|
||||||
|
|
||||||
fn main() {
|
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 start = Instant::now();
|
||||||
|
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
Loading…
Add table
Reference in a new issue