chetanmeh commented on a change in pull request #4584: OpenWhisk User Events
URL: https://github.com/apache/openwhisk/pull/4584#discussion_r326069009
 
 

 ##########
 File path: 
common/scala/src/main/scala/org/apache/openwhisk/core/entity/ActivationResult.scala
 ##########
 @@ -61,16 +61,25 @@ protected[core] object ActivationResponse extends 
DefaultJsonProtocol {
   val DeveloperError = 2 // action ran but failed to handle an error, or 
action did not run and failed to initialize
   val WhiskError = 3 // internal system error
 
-  protected[core] def messageForCode(code: Int) = {
-    require(code >= Success && code <= WhiskError)
+  val statusSuccess = "success"
+  val statusApplicationError = "application_error"
+  val statusDeveloperError = "action_developer_error"
+  val statusWhiskError = "whisk_internal_error"
+
+  protected[core] def statusForCode(code: Int) = {
+    require(code >= 0 && code <= 3)
     code match {
-      case Success          => "success"
-      case ApplicationError => "application error"
-      case DeveloperError   => "action developer error"
-      case WhiskError       => "whisk internal error"
+      case 0 => ActivationResponse.statusSuccess
 
 Review comment:
   Better to retain use of existing constants. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to