Merge pull request #1102 from gkossakowski/inc-error-handling

Improve error handling in incremental compiler
This commit is contained in:
Josh Suereth 2014-01-28 02:16:43 -08:00
commit 7241428137
2 changed files with 10 additions and 3 deletions

View File

@ -46,5 +46,12 @@ object IC extends IncrementalCompiler[Analysis, AnalyzingCompiler]
}
def readCacheUncaught(file: File): (Analysis, CompileSetup) =
Using.fileReader(IO.utf8)(file) { reader => TextAnalysisFormat.read(reader) }
Using.fileReader(IO.utf8)(file) { reader =>
try {
TextAnalysisFormat.read(reader)
} catch {
case ex: sbt.inc.ReadException =>
throw new java.io.IOException(s"Error while reading $file", ex)
}
}
}

View File

@ -225,8 +225,8 @@ object TextAnalysisFormat {
if (nameHashing)
Relations.make(srcProd, binaryDep, memberRefSrcDeps, inheritanceSrcDeps, classes, names)
else {
assert(names.all.isEmpty, s"When `nameHashing` is disabled `names` relation " +
"should be empty: $names")
assert(names.all.isEmpty, "When `nameHashing` is disabled `names` relation " +
s"should be empty: $names")
Relations.make(srcProd, binaryDep, directSrcDeps, publicInheritedSrcDeps, classes)
}
}