From 497f82084cbdff7e8d91fef93aad26d50febfa6c Mon Sep 17 00:00:00 2001
From: Michele Alberti <michele.alberti@cea.fr>
Date: Wed, 2 Nov 2022 11:56:54 +0100
Subject: [PATCH] Use more appropriate exceptions for invalid command line
 arguments.

---
 src/main.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main.ml b/src/main.ml
index b110dbc..9afb6b4 100644
--- a/src/main.ml
+++ b/src/main.ml
@@ -102,7 +102,7 @@ let memlimit_of_string s =
   | [ v ], ([] | [ "M" ] | [ "MB" ]) -> Int.of_string v
   | [ v ], ([ "G" ] | [ "GB" ]) -> Int.of_string v * 1000
   | [ v ], ([ "T" ] | [ "TB" ]) -> Int.of_string v * 1000000
-  | _ -> failwith "Unrecognized memory limit"
+  | _ -> invalid_arg "Unrecognized memory limit"
 
 let timelimit_of_string s =
   let s = String.strip s in
@@ -118,7 +118,7 @@ let timelimit_of_string s =
   | [ v ], ([] | [ "s" ]) -> Int.of_string v
   | [ v ], [ "m" ] -> Int.of_string v * 60
   | [ v ], [ "h" ] -> Int.of_string v * 3600
-  | _ -> failwith "Unrecognized time limit"
+  | _ -> invalid_arg "Unrecognized time limit"
 
 let verify format loadpath memlimit timelimit prover dataset_csv files =
   let debug = log_level_is_debug () in
-- 
GitLab