Don't report EOFException on shutdown (#7157)

It's part of the normal shutdown workflow and confused users are reporting it as a failure.
This commit is contained in:
Hubert Plociniczak 2023-06-29 15:42:13 +02:00 committed by GitHub
parent 58c81f2975
commit 26bd95cf3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,10 +21,9 @@ import zio.Console.{printLine, printLineError, readLine}
import zio.interop.catz.core._
import zio.{ExitCode, Runtime, Scope, UIO, ZAny, ZIO, ZIOAppArgs, ZIOAppDefault}
import java.io.IOException
import java.io.{EOFException, IOException}
import java.nio.file.{FileAlreadyExistsException, Files, Path, Paths}
import java.util.concurrent.ScheduledThreadPoolExecutor
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, ExecutionContextExecutor}
@ -85,7 +84,12 @@ object ProjectManager extends ZIOAppDefault with LazyLogging {
private def tryReadLine: ZIO[ZAny, Nothing, String] =
readLine.catchAll { err =>
ZIO
.succeed { logger.warn("Failed to read line.", err) }
.succeed {
err match {
case _: EOFException =>
case _ => logger.warn("Failed to read line.", err)
}
}
.as("")
}