From 26bd95cf3dcb7ed57c343921fce61b5d73ec0e5a Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Thu, 29 Jun 2023 15:42:13 +0200 Subject: [PATCH] Don't report EOFException on shutdown (#7157) It's part of the normal shutdown workflow and confused users are reporting it as a failure. --- .../org/enso/projectmanager/boot/ProjectManager.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/scala/project-manager/src/main/scala/org/enso/projectmanager/boot/ProjectManager.scala b/lib/scala/project-manager/src/main/scala/org/enso/projectmanager/boot/ProjectManager.scala index e1b1dbc4fb6..39615edf62f 100644 --- a/lib/scala/project-manager/src/main/scala/org/enso/projectmanager/boot/ProjectManager.scala +++ b/lib/scala/project-manager/src/main/scala/org/enso/projectmanager/boot/ProjectManager.scala @@ -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("") }