From 2a111bd22db7f4d52da1e0b030e1db09ef9ceb18 Mon Sep 17 00:00:00 2001 From: xecarlox94 Date: Wed, 23 Oct 2024 23:43:23 +0100 Subject: [PATCH] improving safety commands --- haskell/app/Main.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/haskell/app/Main.hs b/haskell/app/Main.hs index e7c366e..a36ee25 100644 --- a/haskell/app/Main.hs +++ b/haskell/app/Main.hs @@ -283,8 +283,8 @@ eitherExecProcess cmd opts input = (show input) case code of - ExitFailure i -> pure (Left (MkSystemError i err)) - _ -> pure (Right out) + ExitFailure i -> pure $ Left $ MkSystemError i err + _ -> pure $ Right out @@ -319,6 +319,7 @@ eitherSpawnProcP2Prc cmd opts = let (_, _, _, ph) = creationResult case creationResult of + (_, _, Just _, _) -> do terminateProcess ph pure $ Left $ MkErrorSpawningProcess $ "Error executing: " ++ cmd