@@ -2,7 +2,7 @@ module JSONSchema.Fetch where
22
33import Import
44
5−import Control.Exception (IOException, catch)
5+import qualified Control.Exception.Safe as Safe
66import Control.Monad (foldM)
77import qualified Data.ByteString as BS
88import qualified Data.ByteString.Lazy as LBS
@@ -62,7 +62,7 @@ referencesViaHTTP'
6262referencesViaHTTP' info sw = do
6363 manager <- NC.newManager NCTLS.tlsManagerSettings
6464 let f = referencesMethodAgnostic (getURL manager) info sw
65− catch (first HTTPParseFailure <$> f) handler
65+ Safe.catch (first HTTPParseFailure <$> f) handler
6666 where
6767 getURL :: NC.Manager -> Text -> IO BS.ByteString
6868 getURL man url = do
@@ -88,7 +88,8 @@ referencesViaFilesystem'
8888 => FetchInfo schema
8989 -> SchemaWithURI schema
9090 -> IO (Either FilesystemFailure (URISchemaMap schema))
91−referencesViaFilesystem' info sw = catch (first FSParseFailure <$> f) handler
91+referencesViaFilesystem' info sw =
92+ Safe.catch (first FSParseFailure <$> f) handler
9293 where
9394 f :: IO (Either Text (URISchemaMap schema))
9495 f = referencesMethodAgnostic (BS.readFile . T.unpack) info sw