openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dube...@apache.org
Subject [incubator-openwhisk] branch master updated: Refine error message on failure to fetch action in invoker. (#3139)
Date Wed, 03 Jan 2018 13:35:26 GMT
This is an automated email from the ASF dual-hosted git repository.

dubeejw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new eb20606  Refine error message on failure to fetch action in invoker. (#3139)
eb20606 is described below

commit eb206069b88dd1e103f7b9fbf809820afc8d2943
Author: rodric rabbah <rodric@gmail.com>
AuthorDate: Wed Jan 3 08:35:23 2018 -0500

    Refine error message on failure to fetch action in invoker. (#3139)
---
 common/scala/src/main/scala/whisk/http/ErrorResponse.scala     |  1 +
 .../src/main/scala/whisk/core/invoker/InvokerReactive.scala    | 10 +++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/common/scala/src/main/scala/whisk/http/ErrorResponse.scala b/common/scala/src/main/scala/whisk/http/ErrorResponse.scala
index 9ce5c45..8dcfe20 100644
--- a/common/scala/src/main/scala/whisk/http/ErrorResponse.scala
+++ b/common/scala/src/main/scala/whisk/http/ErrorResponse.scala
@@ -187,6 +187,7 @@ object Messages {
 
   val actionRemovedWhileInvoking = "Action could not be found or may have been deleted."
   val actionMismatchWhileInvoking = "Action version is not compatible and cannot be invoked."
+  val actionFetchErrorWhileInvoking = "Action could not be fetched."
 }
 
 /** Replaces rejections with Json object containing cause and transaction id. */
diff --git a/core/invoker/src/main/scala/whisk/core/invoker/InvokerReactive.scala b/core/invoker/src/main/scala/whisk/core/invoker/InvokerReactive.scala
index 1a772b9..c885c85 100644
--- a/core/invoker/src/main/scala/whisk/core/invoker/InvokerReactive.scala
+++ b/core/invoker/src/main/scala/whisk/core/invoker/InvokerReactive.scala
@@ -47,7 +47,7 @@ import whisk.core.containerpool.ContainerProxy
 import whisk.core.containerpool.PrewarmingConfig
 import whisk.core.containerpool.Run
 import whisk.core.containerpool.logging.LogStoreProvider
-import whisk.core.database.NoDocumentException
+import whisk.core.database._
 import whisk.core.entity._
 import whisk.core.entity.size._
 import whisk.http.Messages
@@ -201,8 +201,12 @@ class InvokerReactive(config: WhiskConfig, instance: InstanceId, producer:
Messa
               // making this an application error. All other errors are considered system
               // errors and should cause the invoker to be considered unhealthy.
               val response = t match {
-                case _: NoDocumentException => ActivationResponse.applicationError(Messages.actionRemovedWhileInvoking)
-                case _                      => ActivationResponse.whiskError(Messages.actionMismatchWhileInvoking)
+                case _: NoDocumentException =>
+                  ActivationResponse.applicationError(Messages.actionRemovedWhileInvoking)
+                case _: DocumentTypeMismatchException | _: DocumentUnreadable =>
+                  ActivationResponse.whiskError(Messages.actionMismatchWhileInvoking)
+                case _ =>
+                  ActivationResponse.whiskError(Messages.actionFetchErrorWhileInvoking)
               }
               val now = Instant.now
               val causedBy = if (msg.causedBySequence) {

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message