Skip to content

Commit 7504a9f

Browse files
Print NoSuchThing errors only to screen (#2446)
Co-authored-by: andreiburdusa <[email protected]>
1 parent abf0292 commit 7504a9f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kore/src/Kore/BugReport.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ License : NCSA
44
55
-}
66

7+
{-# LANGUAGE Strict #-}
8+
79
module Kore.BugReport
810
( BugReport (..)
911
, BugReportOption (..)
@@ -31,6 +33,10 @@ import qualified Data.ByteString.Lazy as ByteString.Lazy
3133
import Debug
3234
import qualified Generics.SOP as SOP
3335
import qualified GHC.Generics as GHC
36+
import GHC.IO.Exception
37+
( IOErrorType (..)
38+
, IOException (ioe_type)
39+
)
3440
import Options.Applicative
3541
import System.Directory
3642
( listDirectory
@@ -138,6 +144,10 @@ withBugReport exeName bugReportOption act =
138144
optionalWriteBugReport tmpDir
139145
| Just UserInterrupt == fromException someException ->
140146
optionalWriteBugReport tmpDir
147+
| Just (ioe :: IOException) <- fromException someException
148+
, NoSuchThing <- ioe_type ioe -> do
149+
putStrLn $ displayException someException
150+
optionalWriteBugReport tmpDir
141151
| otherwise -> do
142152
let message = displayException someException
143153
writeFile (tmpDir </> "error" <.> "log") message

0 commit comments

Comments
 (0)