sigma.exceptions.SigmaExceptions.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sigma-state_2.12 Show documentation
Show all versions of sigma-state_2.12 Show documentation
Interpreter of a Sigma-State language
The newest version!
package sigma.exceptions
import sigma.SigmaException
import sigma.ast.JitCost
/** Exception thrown by [[sigmastate.interpreter.Interpreter]].
*
* @param message the error message
* @param cause an optional cause for the exception
*/
class InterpreterException(message: String, cause: Option[Throwable] = None)
extends SigmaException(message, cause)
/** Exception thrown when the estimated cost exceeds the allowed cost limit.
*
* @param estimatedCost the estimated cost of execution
* @param message the error message
* @param cause an optional cause for the exception
*/
class CostLimitException(
val estimatedCost: Long,
message: String,
cause: Option[Throwable] = None)
extends SigmaException(message, cause)
object CostLimitException {
/** Generates a cost limit error message.
*
* @param cost the estimated cost of execution
* @param limit the allowed cost limit
*/
def msgCostLimitError(
cost: JitCost,
limit: JitCost) = s"Estimated execution cost $cost exceeds the limit $limit"
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy