Skip to content

Print NoSuchThing errors only to screen #2446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions kore/src/Kore/BugReport.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ License : NCSA

-}

{-# LANGUAGE Strict #-}

module Kore.BugReport
( BugReport (..)
, BugReportOption (..)
Expand Down Expand Up @@ -31,6 +33,10 @@ import qualified Data.ByteString.Lazy as ByteString.Lazy
import Debug
import qualified Generics.SOP as SOP
import qualified GHC.Generics as GHC
import GHC.IO.Exception
( IOErrorType (..)
, IOException (ioe_type)
)
import Options.Applicative
import System.Directory
( listDirectory
Expand Down Expand Up @@ -138,6 +144,10 @@ withBugReport exeName bugReportOption act =
optionalWriteBugReport tmpDir
| Just UserInterrupt == fromException someException ->
optionalWriteBugReport tmpDir
| Just (ioe :: IOException) <- fromException someException
, NoSuchThing <- ioe_type ioe -> do
putStrLn $ displayException someException
optionalWriteBugReport tmpDir
| otherwise -> do
let message = displayException someException
writeFile (tmpDir </> "error" <.> "log") message
Expand Down