aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/com/drivergrp/core/rest.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/com/drivergrp/core/rest.scala')
-rw-r--r--src/main/scala/com/drivergrp/core/rest.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/scala/com/drivergrp/core/rest.scala b/src/main/scala/com/drivergrp/core/rest.scala
index ebfb98e..89a0c75 100644
--- a/src/main/scala/com/drivergrp/core/rest.scala
+++ b/src/main/scala/com/drivergrp/core/rest.scala
@@ -60,7 +60,9 @@ object rest {
log.audit(s"Sending to ${request.uri} request $request")
val responseEntity = Http()(actorSystem).singleRequest(request)(materializer) map { response =>
- if(response.status.isFailure() && response.status != StatusCodes.NotFound) {
+ if(response.status == StatusCodes.NotFound) {
+ Unmarshal(HttpEntity.Empty: ResponseEntity)
+ } else if(response.status.isFailure()) {
throw new Exception("Http status is failure " + response.status)
} else {
Unmarshal(response.entity.transformDataBytes(decryptionFlow))