Replace error with fail

This commit is contained in:
Alessandro Marrella 2019-12-16 10:30:04 +00:00
parent 02328e146b
commit 7670b516c8
No known key found for this signature in database
GPG Key ID: A1550631FC3976D3

View File

@ -130,12 +130,12 @@ main = do
if crd then do
crdFile <- decodeFileEither filename
case crdFile of
Left e -> error $ "Unable to decode the CRD file. " <> show e
Left e -> fail $ "Unable to decode the CRD file. " <> show e
Right s -> (pure . Data.Map.fromList . maybeToList . Convert.toDefinition) s
else do
swaggerFile <- decodeFileStrict filename
case swaggerFile of
Nothing -> error "Unable to decode the Swagger file"
Nothing -> fail "Unable to decode the Swagger file"
Just (Swagger{..}) -> pure definitions
let fix m = Data.Map.adjust patchCyclicImports (ModelName m)