Skip to content
Snippets Groups Projects
Commit 3cdc0a22 authored by Rodrigo Mesquita's avatar Rodrigo Mesquita :seedling: Committed by Mikolaj
Browse files

Prefer ErrorCall to ErrorCallWithLocation

This future proofs the code for CLC#285, which will remove
`ErrorCallWithLocation` to de-duplicate duplicate CallStacks.

ErrorCall is already a pattern synonym with the same meaning as it will
have in the future, so this change is backwards compatible too.

(cherry picked from commit db683f26)
parent 57cbb081
No related branches found
No related tags found
No related merge requests found
...@@ -20,4 +20,4 @@ decodeOrFailIO :: Binary a => ByteString -> IO (Either String a) ...@@ -20,4 +20,4 @@ decodeOrFailIO :: Binary a => ByteString -> IO (Either String a)
decodeOrFailIO bs = decodeOrFailIO bs =
catch (evaluate (decode bs) >>= return . Right) handler catch (evaluate (decode bs) >>= return . Right) handler
where where
handler (ErrorCallWithLocation str _) = return $ Left str handler (ErrorCall str) = return $ Left str
...@@ -277,7 +277,7 @@ structuredDecodeOrFailIO :: (Binary.Binary a, Structured a) => LBS.ByteString -> ...@@ -277,7 +277,7 @@ structuredDecodeOrFailIO :: (Binary.Binary a, Structured a) => LBS.ByteString ->
structuredDecodeOrFailIO bs = structuredDecodeOrFailIO bs =
catch (evaluate (structuredDecode bs) >>= return . Right) handler catch (evaluate (structuredDecode bs) >>= return . Right) handler
where where
handler (ErrorCallWithLocation str _) = return $ Left str handler (ErrorCall str) = return $ Left str
-- | Lazily reconstruct a value previously written to a file. -- | Lazily reconstruct a value previously written to a file.
structuredDecodeFileOrFail :: (Binary.Binary a, Structured a) => FilePath -> IO (Either String a) structuredDecodeFileOrFail :: (Binary.Binary a, Structured a) => FilePath -> IO (Either String a)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment