@@ -99,7 +99,7 @@ data CabalInstallException
9999 | UnknownExecutable String UnitId
100100 | MultipleMatchingExecutables String [String ]
101101 | CmdRunReportTargetProblems String
102- | CleanAction [String ]
102+ | CleanActionNotScript [String ]
103103 | ReportCannotPruneDependencies String
104104 | ReplCommandDoesn'tSupport
105105 | ReplTakesNoArguments [String ]
@@ -192,6 +192,7 @@ data CabalInstallException
192192 | LegacyAndParsecParseResultsDiffer FilePath String String
193193 | CabalFileParseFailure CabalFileParseError
194194 | ProjectConfigParseFailure ProjectConfigParseError
195+ | CleanActionNotPackage
195196 deriving (Show )
196197
197198exceptionCodeCabalInstall :: CabalInstallException -> Int
@@ -255,7 +256,7 @@ exceptionCodeCabalInstall e = case e of
255256 UnknownExecutable {} -> 7068
256257 MultipleMatchingExecutables {} -> 7069
257258 CmdRunReportTargetProblems {} -> 7070
258- CleanAction {} -> 7071
259+ CleanActionNotScript {} -> 7071
259260 ReportCannotPruneDependencies {} -> 7072
260261 ReplCommandDoesn'tSupport {} -> 7073
261262 ReplTakesNoArguments {} -> 7074
@@ -348,6 +349,7 @@ exceptionCodeCabalInstall e = case e of
348349 LegacyAndParsecParseResultsDiffer {} -> 7165
349350 CabalFileParseFailure {} -> 7166
350351 ProjectConfigParseFailure {} -> 7167
352+ CleanActionNotPackage {} -> 7168
351353
352354exceptionMessageCabalInstall :: CabalInstallException -> String
353355exceptionMessageCabalInstall e = case e of
@@ -458,7 +460,7 @@ exceptionMessageCabalInstall e = case e of
458460 ++ " :\n "
459461 ++ unlines elabUnitId
460462 CmdRunReportTargetProblems renderProb -> renderProb
461- CleanAction notScripts ->
463+ CleanActionNotScript notScripts ->
462464 " 'clean' extra arguments should be script files: "
463465 ++ unwords notScripts
464466 ReportCannotPruneDependencies renderCannotPruneDependencies -> renderCannotPruneDependencies
@@ -885,6 +887,8 @@ exceptionMessageCabalInstall e = case e of
885887 renderCabalFileParseError cbfError
886888 ProjectConfigParseFailure pcfError ->
887889 renderProjectConfigParseError pcfError
890+ CleanActionNotPackage ->
891+ " Not a cabal project or package directory; skipping project cleanup."
888892
889893instance Exception (VerboseException CabalInstallException ) where
890894 displayException :: VerboseException CabalInstallException -> [Char ]
0 commit comments