Make Watched use State#handleError

This commit is contained in:
Dale Wijnand 2018-03-12 17:13:17 +00:00
parent 933668076a
commit 9c0ac90ee9
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
3 changed files with 6 additions and 4 deletions

View File

@ -383,6 +383,8 @@ lazy val commandProj = (project in file("main-command"))
// Replace nailgun socket stuff
exclude[MissingClassProblem]("sbt.internal.NG*"),
exclude[MissingClassProblem]("sbt.internal.ReferenceCountedFileDescriptor"),
// made private[sbt] method private[this]
exclude[DirectMissingMethodProblem]("sbt.State.handleException"),
),
unmanagedSources in (Compile, headerCreate) := {
val old = (unmanagedSources in (Compile, headerCreate)).value

View File

@ -323,7 +323,7 @@ object State {
import ExceptionCategory._
private[sbt] def handleException(t: Throwable, s: State, log: Logger): State = {
private[this] def handleException(t: Throwable, s: State, log: Logger): State = {
ExceptionCategory(t) match {
case AlreadyHandled => ()
case m: MessageOnly => log.error(m.message)

View File

@ -112,9 +112,9 @@ object Watched {
(triggered, newWatchState)
} catch {
case e: Exception =>
val log = s.log
log.error("Error occurred obtaining files to watch. Terminating continuous execution...")
State.handleException(e, s, log)
s.log.error(
"Error occurred obtaining files to watch. Terminating continuous execution...")
s.handleError(e)
(false, watchState)
}