All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.specs2.control.ActionException.scala Maven / Gradle / Ivy

The newest version!
package org.specs2
package control

/**
 * This exception class is used when an Action is transformed to a Task to avoid losing information
 */
case class ActionException(warnings: List[String], message: Option[String], throwable: Option[Throwable]) extends Exception {
  override def getMessage: String =
    (if (warnings.nonEmpty) warnings.mkString("Warnings:\n", "\n", "\n") else "") +
    message.map(_ + "\n").getOrElse("") +
    throwable.map(t => t.getStackTrace.mkString(t.getMessage+"\n", "\n", "")).getOrElse("")
}

/**
 * This exception class is used to notify the user of instantiation errors
 */
case class UserException(message: String, throwable: Throwable) extends Exception(message, throwable)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy