diff --git a/src/Utils/Files.hs b/src/Utils/Files.hs index 71fb968a2..e171dba0d 100644 --- a/src/Utils/Files.hs +++ b/src/Utils/Files.hs @@ -33,11 +33,7 @@ sinkFile File{ fileContent = Just fileContentContent, .. } = do let uploadName = decodeUtf8 . Base64.encodeUnpadded $ ByteArray.convert fileContentHash uploadBucket <- getsYesod $ views appSettings appUploadCacheBucket unless inDB . runAppMinio $ do - let isDoesNotExist :: HttpException -> Bool - isDoesNotExist (HttpExceptionRequest _ (StatusCodeException resp _)) - = responseStatus resp == notFound404 - isDoesNotExist _ = False - uploadExists <- handleIf isDoesNotExist (const $ return False) $ True <$ Minio.statObject uploadBucket uploadName Minio.defaultGetObjectOptions + uploadExists <- handleIf minioIsDoesNotExist (const $ return False) $ True <$ Minio.statObject uploadBucket uploadName Minio.defaultGetObjectOptions unless uploadExists $ do let pooOptions = Minio.defaultPutObjectOptions