Merge pull request #4016 from dwijnand/cleanup/Watched

Make Watched use State#handleError
This commit is contained in:
Dale Wijnand 2018-03-20 08:54:18 +00:00 committed by GitHub
commit fe418c92a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}