Show CmdLineError exceptions as "<command line>: ..."
authorSimon Marlow <simonmar@microsoft.com>
Wed, 23 Jan 2008 16:31:45 +0000 (16:31 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 23 Jan 2008 16:31:45 +0000 (16:31 +0000)
instead of something like "ghc-6.8.2: ...", which causes problems in
the test suite.  In any case, "<command line>" seems a more
appropriate context for these errors, the only question is whether
we're using CmdLineError incorrectly anywhere.

compiler/utils/Panic.lhs

index defbbef..ffd3b67 100644 (file)
@@ -89,6 +89,7 @@ showException other_exn                        = show other_exn
 
 instance Show GhcException where
   showsPrec _ e@(ProgramError _) = showGhcException e
+  showsPrec _ e@(CmdLineError _) = showString "<command line>: " . showGhcException e
   showsPrec _ e = showString progName . showString ": " . showGhcException e
 
 showGhcException :: GhcException -> String -> String