mirror of https://github.com/sbt/sbt.git
error handling adjustments, including showing failing task in red (for #29)
This commit is contained in:
parent
f0608da0a8
commit
d1ad850a12
|
|
@ -21,6 +21,15 @@ object ErrorHandling
|
|||
def convert[T](f: => T): Either[Exception, T] =
|
||||
try { Right(f) }
|
||||
catch { case e: Exception => Left(e) }
|
||||
|
||||
def reducedToString(e: Throwable): String =
|
||||
if(e.getClass == classOf[RuntimeException])
|
||||
{
|
||||
val msg = e.getMessage
|
||||
if(msg == null || msg.isEmpty) e.toString else msg
|
||||
}
|
||||
else
|
||||
e.toString
|
||||
}
|
||||
final class TranslatedException private[sbt](msg: String, cause: Throwable) extends RuntimeException(msg, cause)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue