on master help sign in
Don't wrap up async exceptions (fixes #185)
commit4fac88c952fb4d3195535c310dea039cfa7f2564 authorMichael Snoyman <michael@snoyman.com> dateMon 9 Mar 2020, 15:30 (7 years ago) parent3ab3fd9
3 files changed+11−6
yaml/ChangeLog.md+4 yaml/package.yaml+1−1 yaml/src/Data/Yaml/Internal.hs+6−5
yaml/ChangeLog.md+4
@@ -1,5 +1,9 @@
11# ChangeLog for yaml
22
3+## 0.11.3.0
4+
5+* Don't wrap up async exceptions [#185](https://github.com/snoyberg/yaml/issues/185)
6+
37## 0.11.2.0
48
59* Reduces some of the code duplication between the `encode` and `encodePretty` functions
yaml/package.yaml+1−1
@@ -1,5 +1,5 @@
11name: yaml
2−version: 0.11.2.0
2+version: 0.11.3.0
33synopsis: Support for parsing and rendering YAML documents.
44description: README and API documentation are available at <https://www.stackage.org/package/yaml>
55category: Data
yaml/src/Data/Yaml/Internal.hs+6−5
@@ -303,12 +303,13 @@ decodeHelper_ :: FromJSON a
303303 -> IO (Either ParseException ([Warning], a))
304304decodeHelper_ src = do
305305 x <- try $ runResourceT $ runStateT (runConduit $ src .| runReaderT parse []) (ParseState Map.empty [])
306− return $ case x of
306+ case x of
307307 Left e
308− | Just pe <- fromException e -> Left pe
309− | Just ye <- fromException e -> Left $ InvalidYaml $ Just (ye :: YamlException)
310− | otherwise -> Left $ OtherParseException e
311− Right (y, st) -> either
308+ | Just pe <- fromException e -> return $ Left pe
309+ | Just ye <- fromException e -> return $ Left $ InvalidYaml $ Just (ye :: YamlException)
310+ | Just sae <- fromException e -> throwIO (sae :: SomeAsyncException)
311+ | otherwise -> return $ Left $ OtherParseException e
312+ Right (y, st) -> return $ either
312313 (Left . AesonException)
313314 Right
314315 ((,) (parseStateWarnings st) <$> parseEither parseJSON y)