hamzaremmal/amy

View on GitHub
compiler/src/main/scala/amyc/utils/AmycFatalError.scala

Summary

Maintainability
A
0 mins
Test Coverage
F
16%
package amyc.utils

import amyc.*
import amyc.core.Context

case class AmycFatalError(msg: String) extends Exception(msg)

object error {
  
  def checkAmycErrors[A](body: => A)(using Context): A =
    try{
      body
    } catch
      case AmycFatalError(msg) =>
        sys.exit(1)
        
  
}