@@ -20,33 +20,33 @@ private[sbt] object Retry {
2020 try System .getProperty(" sbt.io.retry.limit" , defaultLimit.toString).toInt
2121 catch { case NonFatal (_) => defaultLimit }
2222 }
23- private [sbt] def apply [@ specialized T ](f : => T , excludedExceptions : Class [? <: IOException ]* ): T =
23+ private [sbt] def apply [@ specialized T ](f : => T , excludedExceptions : Class [? <: Throwable ]* ): T =
2424 apply(f, limit, excludedExceptions : _* )
2525 private [sbt] def apply [@ specialized T ](
2626 f : => T ,
2727 limit : Int ,
28- excludedExceptions : Class [? <: IOException ]* ,
28+ excludedExceptions : Class [? <: Throwable ]* ,
2929 ): T = apply(f, limit, 100 , excludedExceptions : _* )
3030 private [sbt] def apply [@ specialized T ](
3131 f : => T ,
3232 limit : Int ,
3333 sleepInMillis : Long ,
34- excludedExceptions : Class [? <: IOException ]* ,
34+ excludedExceptions : Class [? <: Throwable ]* ,
3535 ): T = {
3636 require(limit >= 1 , " limit must be 1 or higher: was: " + limit)
37- def filter (e : Exception ): Boolean = excludedExceptions match {
37+ def filter (e : Throwable ): Boolean = excludedExceptions match {
3838 case s if s.nonEmpty =>
3939 ! excludedExceptions.exists(_.isAssignableFrom(e.getClass))
4040 case _ =>
4141 true
4242 }
4343 var attempt = 1
44- var firstException : IOException = null
44+ var firstException : Throwable = null
4545 while (attempt <= limit) {
4646 try {
4747 return f
4848 } catch {
49- case e : IOException if filter(e) =>
49+ case NonFatal (e) if filter(e) =>
5050 if (firstException == null ) firstException = e
5151 // https://github.com/sbt/io/issues/295
5252 // On Windows, we're seeing java.nio.file.AccessDeniedException with sleep(0).
0 commit comments