From 99ebbb98068324c2c26dd59484acbe9a8b62ae59 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Tue, 18 Jul 2017 17:30:52 -0700 Subject: Fixes to error message handling --- src/main/scala/xyz/driver/pdsuicommon/error/DomainError.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main/scala/xyz/driver/pdsuicommon/error/DomainError.scala') diff --git a/src/main/scala/xyz/driver/pdsuicommon/error/DomainError.scala b/src/main/scala/xyz/driver/pdsuicommon/error/DomainError.scala index fc8e474..c761414 100644 --- a/src/main/scala/xyz/driver/pdsuicommon/error/DomainError.scala +++ b/src/main/scala/xyz/driver/pdsuicommon/error/DomainError.scala @@ -32,7 +32,10 @@ object DomainError { /** Subclasses of this exception correspond to subclasses of DomainError. They * are used in REST service implementations to fail futures rather than * returning successful futures, completed with corresponding DomainErrors. */ -class DomainException(message: String) extends RuntimeException(message) -class NotFoundException(message: String) extends DomainException(message) // 404 -class AuthenticationException(message: String) extends DomainException(message) // 401 -class AuthorizationException(message: String) extends DomainException(message) // 403 +// scalastyle:off null +@SuppressWarnings(Array("org.wartremover.warts.Null")) +class DomainException(message: String, cause: Throwable = null) extends RuntimeException(message, cause) +class NotFoundException(message: String) extends DomainException(message) // 404 +class AuthenticationException(message: String) extends DomainException(message) // 401 +class AuthorizationException(message: String) extends DomainException(message) // 403 +// scalastyle:on null -- cgit v1.2.3