jthomas commented on a change in pull request #3: Fixing numerous issues 
discovered whilst developing new event source 
URL: 
https://github.com/apache/incubator-openwhisk-pluggable-provider/pull/3#discussion_r290289829
 
 

 ##########
 File path: actions/event-actions/changesWebAction.js
 ##########
 @@ -36,7 +36,7 @@ function main(params) {
           common.verifyTriggerAuth(triggerData, false)
             .then(() => EventProvider.validate(params))
             .catch(err => {
-              return reject(common.sendError(400, `Feed parameter validation 
failed`, err.message));
+              throw common.sendError(400, `Feed parameter validation failed`, 
err.message);
 
 Review comment:
   The existing code returns the result of the `reject` function which is a 
non-error value and causes the following `then` handlers to run (which is not 
what we want). By throwing the error, all the `then` handlers are skipped and 
the `catch` at the end can reject the returned promise with the error from the 
validation issue. Did you spot something else?

----------------------------------------------------------------
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