Skip to content
Snippets Groups Projects
Commit 7bcd4243 authored by Régis Blanc's avatar Régis Blanc
Browse files

use LeonFatalError to exit

parent 8d704341
No related branches found
No related tags found
No related merge requests found
package leon
case class LeonFatalError() extends Exception
......@@ -157,7 +157,11 @@ object Main {
// Compute leon pipeline
val pipeline = computePipeline(ctx.settings)
// Run pipeline
pipeline.run(ctx)(args.toList)
try {
// Run pipeline
pipeline.run(ctx)(args.toList)
} catch {
case LeonFatalError() => sys.exit(1)
}
}
}
......@@ -53,7 +53,7 @@ class DefaultReporter extends Reporter {
def errorFunction(msg: Any) = output(reline(errorPfx, msg.toString))
def warningFunction(msg: Any) = output(reline(warningPfx, msg.toString))
def infoFunction(msg: Any) = output(reline(infoPfx, msg.toString))
def fatalErrorFunction(msg: Any) = { output(reline(fatalPfx, msg.toString)); sys.exit(0) }
def fatalErrorFunction(msg: Any) = { output(reline(fatalPfx, msg.toString)); throw LeonFatalError() }
}
class QuietReporter extends DefaultReporter {
......
......@@ -24,7 +24,7 @@ class AnalysisComponent(val global: Global, val pluginInstance: LeonPlugin)
protected def stopIfErrors: Unit = {
if(reporter.hasErrors) {
sys.exit(1)
throw LeonFatalError()
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment