Skip to content

Commit 3a5ef35

Browse files
committed
cardano-testnet: improve names of errors, write haddock, and improve messages
1 parent cebb3f6 commit 3a5ef35

File tree

1 file changed

+7
-4
lines changed
  • cardano-testnet/src/Testnet/Process

1 file changed

+7
-4
lines changed

cardano-testnet/src/Testnet/Process/Run.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,11 @@ data ExecutableError
312312
= CannotDecodePlanJSON FilePath String
313313
| RetrievePlanJsonFailure IOException
314314
| ReadFileFailure IOException
315-
| MissingExecutable FilePath String
316-
| CannotFindExecutable String
315+
| ExecutableMissingInComponent FilePath String
316+
-- ^ Component with key @component-name@ is found, but it is missing
317+
-- the @bin-file@ key.
318+
| ExecutableNotFoundInPlan String
319+
-- ^ Component with key @component-name@ cannot be found
317320
deriving Show
318321

319322

@@ -334,8 +337,8 @@ binDist pkg = do
334337
Right plan -> case List.filter matching (plan & installPlan) of
335338
(component:_) -> case component & binFile of
336339
Just bin -> return $ addExeSuffix (Text.unpack bin)
337-
Nothing -> left $ MissingExecutable pJsonFp $ "missing bin-file in: " <> show component
338-
[] -> left $ CannotFindExecutable $ "Cannot find exe: " <> pkg
340+
Nothing -> left $ ExecutableMissingInComponent pJsonFp $ "missing \"bin-file\" key in plan component: " <> show component
341+
[] -> left $ ExecutableNotFoundInPlan $ "Cannot find \"component-name\" key with value \"exe:" <> pkg <> "\""
339342
Left message -> left $ CannotDecodePlanJSON pJsonFp $ "Cannot decode plan: " <> message
340343
where matching :: Component -> Bool
341344
matching component = case componentName component of

0 commit comments

Comments
 (0)