package gr.grnet.aquarium
/**
- * Should be the base of all Aquarium-related internal errors.
+ * An internal Aquarium error. This signifies a bug.
*
* @author Christos KK Loverdos <loverdos@gmail.com>
*/
-class AquariumInternalError(cause: Throwable, message: String) extends RuntimeException(message, cause) {
+class AquariumInternalError(
+ cause: Throwable,
+ message: String,
+ args: Any*
+) extends RuntimeException(message.format(args:_*), cause) {
+
if(message eq null) throw new IllegalArgumentException("Null message in exception")
def this(cause: Throwable) = this(cause, "")
- def this(message: String) = this(null, message)
+ def this(message: String, args: Any*) = this(null: Throwable, message, args:_*)
def this(message: String, cause: Throwable) = this(cause, message)
}