You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/03 13:35:27 UTC
[GitHub] dubeejw closed pull request #3139: Refine error message on failure to fetch action in invoker.
dubeejw closed pull request #3139: Refine error message on failure to fetch action in invoker.
URL: https://github.com/apache/incubator-openwhisk/pull/3139
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/common/scala/src/main/scala/whisk/http/ErrorResponse.scala b/common/scala/src/main/scala/whisk/http/ErrorResponse.scala
index 9ce5c45561..8dcfe2077b 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 1a772b9a66..c885c8581d 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) {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services