Fix regression where IOExceptions were not caught on trying to access disk.

Fixes #1632
This commit is contained in:
Josh Suereth 2014-10-01 08:04:39 -04:00
parent e96d40ebbd
commit b9dc9f8f4f
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,7 @@
*/
package sbt
import java.io.File
import java.io.{ IOException, File }
import java.net.URL
import scala.xml.{ Text, NodeSeq, Elem, XML }
import org.apache.ivy.plugins.resolver.DependencyResolver
@ -312,6 +312,8 @@ object Resolver {
} catch {
// Occurs inside File constructor when property or environment variable does not exist
case _: NullPointerException => None
// Occurs when File does not exist
case _: IOException => None
case e: SAXParseException => System.err.println(s"WARNING: Problem parsing ${f().getAbsolutePath}, ${e.getMessage}"); None
}
loadHomeFromSettings(() => new File(Path.userHome, ".m2/settings.xml")) orElse