Skip to content

Commit

Permalink
Wrap request so we don't NPE when it is null
Browse files Browse the repository at this point in the history
  • Loading branch information
sihil committed Mar 31, 2017
1 parent d17f603 commit 37f0d08
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
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 37f0d08

Please sign in to comment.