aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-12 04:00:51 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-12 04:00:51 +0100
commitde1a0f087367393b35615693c71d1e26efea6fdd (patch)
treed619bcc3847cc52a32569badf93464a17a43738f
parentaef8e4b26da7689ec03ad4a98ef94e833c363c29 (diff)
chore: propagate error message in `DecodeException`
-rw-r--r--src/Process/Shell.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Process/Shell.hs b/src/Process/Shell.hs
index 2542a2f..904b70f 100644
--- a/src/Process/Shell.hs
+++ b/src/Process/Shell.hs
@@ -72,13 +72,13 @@ instance Outputable T.Text where
instance Outputable LT.Text where
fromLBS = LT.decodeUtf8
-data DecodeException = DecodeException
+data DecodeException = DecodeException String
deriving (Show)
instance Exception DecodeException
instance (FromJSON a) => Outputable a where
- fromLBS = fromMaybe (throw DecodeException) . decode
+ fromLBS = either (throw . DecodeException) id . eitherDecode
class Quotable a where
toString :: a -> String