1module Mach.Error where 2 3import Control.Exception 4import qualified Text.ParserCombinators.Parsec as P 5 6data TargetError 7 = ZeroTargetsDefined 8 | MultipleDefines 9 | UnexpectedPrereqs10 | NoTargetOrFile FilePath11 | NoSuchTarget String1213instance Show TargetError where14 show ZeroTargetsDefined = "no targets defined"15 show MultipleDefines = "only one rule for a target can contain commands"16 show UnexpectedPrereqs = "unexpected prerequisites"17 show (NoSuchTarget tgt) = "no target named " ++ tgt ++ " was defined"18 show (NoTargetOrFile n) = "no target or file named " ++ n1920data MakeErr21 = ParserErr P.ParseError22 | TargetErr TargetError23 | ExecErr String24 deriving (Show)2526instance Exception MakeErr