From 30aecfc754a75f0c873c99a4f1f8f45af62889ac Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 6 Oct 2017 14:24:17 +0200 Subject: Error handling --- iclm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/iclm b/iclm index 6931d59..0b49881 100755 --- a/iclm +++ b/iclm @@ -62,16 +62,26 @@ proc tryCompile { } { expect { -re "Error \\\[.*\\\]: (.*)\.dcl could not be imported" { tryImport $expect_out(1,string) + return } -re "Can't find (.*)\.icl" { tryImport $expect_out(1,string) + return } "Nonrepresentable section on output" { set args "$args -l -no-pie" feedback "info" "Using -l -no-pie." tryCompile - } eof { - feedback "success" "Done." + return } } + + catch wait reason + if {[lindex $reason 3] == 0} { + feedback "success" "Done building." + } else { + feedback "error" "Errors, see transcript." + } + + exit [lindex $reason 3] } tryCompile -- cgit v1.2.3