2010-08-19 07:01:09 +02:00
|
|
|
/**
|
2014-02-02 19:05:45 -06:00
|
|
|
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
|
2010-08-19 07:01:09 +02:00
|
|
|
*/
|
|
|
|
|
|
2010-10-26 12:49:25 +02:00
|
|
|
package akka
|
2010-08-19 07:01:09 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Akka base Exception. Each Exception gets:
|
|
|
|
|
* <ul>
|
2011-04-06 15:55:42 +12:00
|
|
|
* <li>a uuid for tracking purposes</li>
|
2011-06-17 21:54:02 +02:00
|
|
|
* <li>toString that includes exception name, message and uuid</li>
|
2010-08-19 07:01:09 +02:00
|
|
|
* </ul>
|
|
|
|
|
*/
|
2012-07-30 13:26:12 +02:00
|
|
|
@SerialVersionUID(1L)
|
2012-05-21 19:59:42 +02:00
|
|
|
class AkkaException(message: String, cause: Throwable) extends RuntimeException(message, cause) with Serializable {
|
2012-05-18 19:25:43 +02:00
|
|
|
def this(msg: String) = this(msg, null)
|
2010-08-19 07:01:09 +02:00
|
|
|
}
|
2012-05-16 17:04:13 +02:00
|
|
|
|
2012-12-20 12:59:48 +01:00
|
|
|
/**
|
|
|
|
|
* Mix in this trait to suppress the StackTrace for the instance of the exception but not the cause,
|
|
|
|
|
* scala.util.control.NoStackTrace suppresses all the StackTraces.
|
|
|
|
|
*/
|
|
|
|
|
trait OnlyCauseStackTrace { self: Throwable ⇒
|
|
|
|
|
override def fillInStackTrace(): Throwable = {
|
|
|
|
|
setStackTrace(getCause match {
|
|
|
|
|
case null ⇒ Array.empty
|
|
|
|
|
case some ⇒ some.getStackTrace
|
|
|
|
|
})
|
|
|
|
|
this
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-16 17:04:13 +02:00
|
|
|
/**
|
|
|
|
|
* This exception is thrown when Akka detects a problem with the provided configuration
|
|
|
|
|
*/
|
2012-05-21 19:59:42 +02:00
|
|
|
class ConfigurationException(message: String, cause: Throwable) extends AkkaException(message, cause) {
|
2012-05-16 17:04:13 +02:00
|
|
|
def this(msg: String) = this(msg, null)
|
|
|
|
|
}
|