Skip to content

Commit

Permalink
Improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasFella committed Dec 2, 2024
1 parent 8e4ad29 commit 921d5a8
Show file tree
Hide file tree
Showing 4 changed files with 992 additions and 603 deletions.
6 changes: 6 additions & 0 deletions Quotient/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,12 @@ void Connection::Private::setupCryptoMachine(const QByteArray& picklingKey)
mxIdForDb.replace(u':', u'_');
const QString databasePath{ QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) % u'/' % mxIdForDb % u'/' % q->deviceId() };
cryptoMachine = crypto::init(stringToRust(q->userId()), stringToRust(q->deviceId()), stringToRust(databasePath), bytesToRust(picklingKey));
if (!(*cryptoMachine)->is_ok()) {
//TODO as part of #782: if crypto machine creation fails, make PendingConnection fail to create a Connection. Then clients can show these errors nicely
// and we don't have to guard all functions for the crypto machine not being available.
qCritical() << "Failed to load crypto machine" << (int) (*cryptoMachine)->error() << stringFromRust((*cryptoMachine)->error_string());
qApp->exit(1);
}
}

void Connection::Private::completeSetup(const QString& mxId, bool newLogin,
Expand Down
Loading

0 comments on commit 921d5a8

Please sign in to comment.