Skip to content

Commit cb8ab60

Browse files
committed
#642 Fix the case when an exception message is null.
1 parent 95a1658 commit cb8ab60

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/peristence/MetastorePersistenceRaw.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class MetastorePersistenceRaw(path: String,
9696
copiedSize += fsSrc.getContentSummary(srcPath).getLength
9797
fsUtilsTrg.copyFileWithRetry(srcPath, trgPath) match {
9898
case None => Seq.empty[String]
99-
case Some(ex) => Seq(ex.getMessage)
99+
case Some(ex) if ex.getMessage != null => Seq(ex.getMessage)
100100
}
101101
}
102102
}

pramen/core/src/main/scala/za/co/absa/pramen/core/utils/FsUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ class FsUtils(conf: Configuration, pathBase: String) {
454454
copyFile(srcFile, dstFile, overwrite)
455455
None
456456
} catch {
457-
case ex: IOException if ex.getMessage.contains("multipart upload") =>
457+
case ex: IOException if Option(ex.getMessage).exists(_.toLowerCase.contains("multipart upload")) =>
458458
if (numberOfAttempts > 1) {
459459
log.warn(s"Failed to copy $srcFile to $dstFile due to multipart upload issue. Retrying in $backoffTimeSeconds seconds...", ex)
460460
Thread.sleep(backoffTimeSeconds * 1000)

0 commit comments

Comments
 (0)