mhenke1 commented on issue #4325: Add error log when fetching an action from 
cloudant fails
URL: 
https://github.com/apache/incubator-openwhisk/pull/4325#issuecomment-486134486
 
 
   @rabbah 
   As you can see in the altered PR I have finally decided against removing the 
`reportFailure` method. 
   
   Reasoning: 
   I finally understood that the underlying problem causing duplicate metrics 
and log markers was that some of the methods threw exceptions of type 
`Exception`. 
   With that`reportFailure` was not able to distinguish between those cases and 
other probably connection related exceptions and was not able to decide to not 
send the metric again.
   
   One option would have been to remove sending the metric in the first case. 
But this would have caused loss of specific error information. So I decided to 
introduces specific ArtifactStoreExceptions for all of missing cases (following 
the pattern of the already existing and used `PutException`).
   
   With that the core problem of sending metrics twice was solved.  
   I now could have moved the decision logic out of `reportFailure`into new or 
existing `recoverWith`sections. 
   In my opinion this would have lead to code duplication which was not worth 
the gain of making the decision more local to the originating place.
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to