diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-23 16:39:25 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-05-23 16:42:40 +0900 |
commit | 73fec4b25d81b73f25309bfb3e274df7553341ea (patch) | |
tree | ffa03b0f82bfc092c4316192fd5e849a92a1193f /lib/connection.h | |
parent | 79403a004129852af10f0a7d9b8dca0276724d28 (diff) | |
download | libquotient-73fec4b25d81b73f25309bfb3e274df7553341ea.tar.gz libquotient-73fec4b25d81b73f25309bfb3e274df7553341ea.zip |
BaseJob: more careful error handling; unify and extend error signals in Connection
(Note: this commit breaks back-compatibility.)
BaseJob::gotReply() had a bold assumption that whenever there's no reasonable JSON body in case of error, that meant IncorrectRequestError (which of course was incorrect). This led to syncs dying in Quaternion because it (correctly) considered IncorrectRequestError to be grave enough to not retry. Closes #206.
Also: don't dump the whole payload to logs, limit with initial 500 characters (closes #205)
Diffstat (limited to 'lib/connection.h')
-rw-r--r-- | lib/connection.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/connection.h b/lib/connection.h index 6dd0db1d..4ce1d127 100644 --- a/lib/connection.h +++ b/lib/connection.h @@ -351,11 +351,12 @@ namespace QMatrixClient void connected(); void reconnected(); //< Unused; use connected() instead void loggedOut(); - void loginError(QString error); - void networkError(int retriesTaken, int inMilliseconds); + void loginError(QString message, QByteArray details); + void networkError(QString message, QByteArray details, + int retriesTaken, int nextRetryInMilliseconds); void syncDone(); - void syncError(QString error); + void syncError(QString message, QByteArray details); void newUser(User* user); |