From 37f0d0886dce4056788c292b1dda846432e95056 Mon Sep 17 00:00:00 2001 From: Simon Hildrew Date: Fri, 31 Mar 2017 17:41:57 +0100 Subject: [PATCH] Wrap request so we don't NPE when it is null --- magenta-lib/src/main/scala/magenta/tasks/AWS.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magenta-lib/src/main/scala/magenta/tasks/AWS.scala b/magenta-lib/src/main/scala/magenta/tasks/AWS.scala index 46f77d6dd..a88f858ee 100644 --- a/magenta-lib/src/main/scala/magenta/tasks/AWS.scala +++ b/magenta-lib/src/main/scala/magenta/tasks/AWS.scala @@ -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