diff options
author | Son HO | 2024-04-04 16:09:48 +0200 |
---|---|---|
committer | GitHub | 2024-04-04 16:09:48 +0200 |
commit | 061d7f72bec27de46245afc82149271ca8c75627 (patch) | |
tree | addd12dec0c1f5a564f9204fda77301771ff5e46 /compiler/Main.ml | |
parent | 3909a38f3f8c58c9f97d36777c52e02617ef70b4 (diff) | |
parent | 77208249c717579d1014f27592566069b8cd0eb2 (diff) |
Merge pull request #106 from AeneasVerif/escherichia/error_catching
Added Error and EError to expressions and propagated related changes
Diffstat (limited to '')
-rw-r--r-- | compiler/Main.ml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/Main.ml b/compiler/Main.ml index db200f37..416f3a07 100644 --- a/compiler/Main.ml +++ b/compiler/Main.ml @@ -274,12 +274,17 @@ let () = (* Translate the functions *) Aeneas.Translate.translate_crate filename dest_dir m - with Errors.CFailure (meta, msg) -> + with Errors.CFailure (_, _) -> (* In theory it shouldn't happen, but there may be uncaught errors - note that we let the [Failure] exceptions go through (they are send if we use the option [-abort-on-error] *) - log#serror (Errors.format_error_message meta msg); - exit 1); + ()); + + if !Errors.error_list <> [] then ( + List.iter + (fun (meta, msg) -> log#serror (Errors.format_error_message meta msg)) + !Errors.error_list; + exit 1); (* Print total elapsed time *) log#linfo |