mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-30 20:45:49 +00:00
core: add error strings to SQLCipher encrypt/decrypt commands (#1014)
This commit is contained in:
committed by
GitHub
parent
19f3890bed
commit
a8216bbd54
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user