From 5f3330ffd4df8d87b97d88789aced1b1b8f7410d Mon Sep 17 00:00:00 2001 From: Zach Smith Date: Mon, 30 Oct 2017 20:27:22 -0700 Subject: Add ExternalServiceException and use in ServiceTransport --- src/main/scala/xyz/driver/core/rest/errors/serviceException.scala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/main/scala/xyz/driver/core/rest/errors') diff --git a/src/main/scala/xyz/driver/core/rest/errors/serviceException.scala b/src/main/scala/xyz/driver/core/rest/errors/serviceException.scala index 7aa70bf..82a1838 100644 --- a/src/main/scala/xyz/driver/core/rest/errors/serviceException.scala +++ b/src/main/scala/xyz/driver/core/rest/errors/serviceException.scala @@ -12,6 +12,10 @@ final case class InvalidActionException(override val message: String = "This act final case class ResourceNotFoundException(override val message: String = "Resource not found") extends ServiceException +final case class ExternalServiceException(serviceName: String, serviceMessage: String) extends ServiceException { + override def message = s"Error while calling another service: $serviceMessage" +} + final case class ExternalServiceTimeoutException( override val message: String = "Another service took too long to respond") extends ServiceException -- cgit v1.2.3