More error indication.

Also fixes #80.
This commit is contained in:
Black Hat
2018-10-15 06:49:30 +08:00
parent 878bcaa84d
commit babe614555
3 changed files with 16 additions and 1 deletions

View File

@@ -74,6 +74,10 @@ void Controller::loginWithCredentials(QString serverAddr, QString user,
account.sync();
addConnection(m_connection);
});
connect(m_connection, &Connection::networkError,
[=](QString error, QByteArray detail) {
emit errorOccured("Network", error);
});
connect(m_connection, &Connection::loginError,
[=](QString error, QByteArray detail) {
emit errorOccured("Login Failed", error);
@@ -141,6 +145,14 @@ void Controller::invokeLogin() {
c->loadState();
addConnection(c);
});
connect(c, &Connection::loginError,
[=](QString error, QByteArray detail) {
emit errorOccured("Login Failed", error);
});
connect(c, &Connection::networkError,
[=](QString error, QByteArray detail) {
emit errorOccured("Network", error);
});
c->connectWithToken(account.userId(), accessToken, account.deviceId());
}
}