Skip to content

Commit

Permalink
Merge pull request #433 from guardian/sh-avoid-npe-on-request
Browse files Browse the repository at this point in the history
Wrap request so we don't NPE when it is null
  • Loading branch information
sihil committed Apr 11, 2017
2 parents d17f603 + e6a658f commit dcbb04f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions magenta-lib/src/main/scala/magenta/tasks/AWS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,9 @@ trait AWS extends Loggable {
override def shouldRetry(originalRequest: AmazonWebServiceRequest, exception: AmazonClientException, retriesAttempted: Int): Boolean = {
val willRetry = super.shouldRetry(originalRequest, exception, retriesAttempted)
if (willRetry) {
logger.warn(s"AWS SDK retry $retriesAttempted: ${originalRequest.getClass.getName} threw ${exceptionInfo(exception)}")
logger.warn(s"AWS SDK retry $retriesAttempted: ${Option(originalRequest).map(_.getClass.getName)} threw ${exceptionInfo(exception)}")
} else {
logger.warn(s"Encounted fatal exception during AWS API call", exception)
logger.warn(s"Encountered fatal exception during AWS API call", exception)
Option(exception.getCause).foreach(t => logger.warn(s"Cause of fatal exception", t))
}
willRetry
Expand Down

0 comments on commit dcbb04f

Please sign in to comment.