Ignore ZipException in cache

Fixes #3050
This commit is contained in:
Eugene Yokota 2017-04-22 05:10:23 -04:00
parent 83581db93f
commit 16c8da21ed
1 changed files with 10 additions and 1 deletions

View File

@ -68,6 +68,7 @@ object Sync {
}
import java.io.{ File, IOException }
import java.util.zip.ZipException
import sbinary._
import Operations.{ read, write }
import DefaultProtocol.{ FileFormat => _, _ }
@ -82,7 +83,15 @@ object Sync {
def readInfo[F <: FileInfo](file: File)(implicit infoFormat: Format[F]): RelationInfo[F] =
try { readUncaught(file)(infoFormat) }
catch { case e: IOException => (Relation.empty, Map.empty) }
catch {
case e: IOException => (Relation.empty, Map.empty)
case e: ZipException => (Relation.empty, Map.empty)
case e: TranslatedException =>
e.getCause match {
case e: ZipException => (Relation.empty, Map.empty)
case _ => throw e
}
}
def readUncaught[F <: FileInfo](file: File)(implicit infoFormat: Format[F]): RelationInfo[F] =
IO.gzipFileIn(file) { in =>