1
0
Fork 0

Minor fix to error handling

This commit is contained in:
Vili Sinervä 2025-02-26 22:52:32 +02:00
parent 02026c42e0
commit 3e4d3fad7d
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
3 changed files with 8 additions and 3 deletions

View file

@ -38,7 +38,10 @@ pub fn start_compiler() {
for line in lines.map_while(Result::ok) {
match compile(&line) {
Ok(_) => println!("\nCompilation OK :)\n"),
Err(e) => println!("\n{}\n", e),
Err(e) => println!(
"{}",
format!("{{\"error\": {}}}", json::stringify(format!("{e}")))
),
}
}
}