From de1a0f087367393b35615693c71d1e26efea6fdd Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 12 Mar 2024 04:00:51 +0100 Subject: chore: propagate error message in `DecodeException` --- src/Process/Shell.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Process/Shell.hs') 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 -- cgit v1.2.3