diff --git a/src/main/scala/leon/Main.scala b/src/main/scala/leon/Main.scala index f2cba94b7fb5fefa2ea254667a3bbee3aae233e7..3cac21a4d260e3a134fdbeb2dc27a44aaad04c49 100644 --- a/src/main/scala/leon/Main.scala +++ b/src/main/scala/leon/Main.scala @@ -228,7 +228,24 @@ object Main { } // Process options - val ctx = processOptions(realArgs) + val ctx = try { + processOptions(realArgs) + } catch { + case LeonFatalError(None) => + sys.exit(1) + + case LeonFatalError(Some(msg)) => + // For the special case of fatal errors not sent though Reporter, we + // send them through reporter one time + try { + new DefaultReporter(Settings()).fatalError(msg) + } catch { + case _: LeonFatalError => + } + + sys.exit(1) + } + try { ctx.interruptManager.registerSignalHandler()