diff --git a/src/Simplex/Chat/Archive.hs b/src/Simplex/Chat/Archive.hs index d67a76520a..8811e3d155 100644 --- a/src/Simplex/Chat/Archive.hs +++ b/src/Simplex/Chat/Archive.hs @@ -130,7 +130,7 @@ export f key key' = do where withDB a err = liftIO (bracket (SQL.open $ T.pack f) SQL.close a) - `catch` \(e :: SomeException) -> liftIO (putStrLn $ "Database error: " <> show e) >> throwDBError err + `catch` \(e :: SomeException) -> liftIO (putStrLn $ "Database error: " <> show e) >> throwDBError (err $ show e) exportSQL = T.unlines $ keySQL key diff --git a/src/Simplex/Chat/Controller.hs b/src/Simplex/Chat/Controller.hs index 92340dfb8d..d6ab336825 100644 --- a/src/Simplex/Chat/Controller.hs +++ b/src/Simplex/Chat/Controller.hs @@ -434,8 +434,8 @@ instance ToJSON ChatErrorType where data DatabaseError = DBENotEncrypted | DBENoFile - | DBEExportFailed - | DBEOpenFailed + | DBEExportFailed {databaseError :: String} + | DBEOpenFailed {databaseError :: String} deriving (Show, Exception, Generic) instance ToJSON DatabaseError where