core: fix error reporting of sqlcipher export errors (#1029)

This commit is contained in:
Evgeny Poberezkin
2022-09-07 17:20:47 +01:00
committed by GitHub
parent 766009269e
commit 3f5ca84c84
3 changed files with 16 additions and 8 deletions
+5
View File
@@ -946,6 +946,8 @@ viewChatError = \case
ChatErrorDatabase err -> case err of
DBErrorEncrypted -> ["error: chat database is already encrypted"]
DBErrorPlaintext -> ["error: chat database is not encrypted"]
DBErrorExport e -> ["error encrypting database: " <> sqliteError' e]
DBErrorOpen e -> ["error opening database after encryption: " <> sqliteError' e]
e -> ["chat database error: " <> sShow e]
ChatErrorAgent err -> case err of
SMP SMP.AUTH ->
@@ -958,6 +960,9 @@ viewChatError = \case
e -> ["smp agent error: " <> sShow e]
where
fileNotFound fileId = ["file " <> sShow fileId <> " not found"]
sqliteError' = \case
SQLiteErrorNotADatabase -> "wrong passphrase or invalid database file"
SQLiteError e -> sShow e
ttyContact :: ContactName -> StyledString
ttyContact = styled $ colored Green