diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/domain/applicationdomaintype.h | 12 | ||||
-rw-r--r-- | common/notification.h | 16 | ||||
-rw-r--r-- | common/synchronizer.cpp | 3 |
3 files changed, 14 insertions, 17 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 8ff3e8b..ae8e6bc 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -92,6 +92,18 @@ | |||
92 | namespace Sink { | 92 | namespace Sink { |
93 | namespace ApplicationDomain { | 93 | namespace ApplicationDomain { |
94 | 94 | ||
95 | enum ErrorCode { | ||
96 | NoError = 0, | ||
97 | UnknownError, | ||
98 | NoServerError, | ||
99 | LoginError, | ||
100 | TransmissionError, | ||
101 | }; | ||
102 | |||
103 | enum SuccessCode { | ||
104 | TransmissionSuccess | ||
105 | }; | ||
106 | |||
95 | struct SINK_EXPORT Error { | 107 | struct SINK_EXPORT Error { |
96 | 108 | ||
97 | }; | 109 | }; |
diff --git a/common/notification.h b/common/notification.h index 87c22db..4b52274 100644 --- a/common/notification.h +++ b/common/notification.h | |||
@@ -49,22 +49,6 @@ public: | |||
49 | Success = 0, | 49 | Success = 0, |
50 | Failure | 50 | Failure |
51 | }; | 51 | }; |
52 | /** | ||
53 | * Used as code for Warning/Error type notifications | ||
54 | */ | ||
55 | enum ErrorCode { | ||
56 | NoError = 0, | ||
57 | UnknownError, | ||
58 | NoServerAvailable, | ||
59 | LoginFailed, | ||
60 | TransmissionFailed, | ||
61 | }; | ||
62 | /** | ||
63 | * Used as code for Info type notifications | ||
64 | */ | ||
65 | enum SuccessCode { | ||
66 | TransmissionSucceeded | ||
67 | }; | ||
68 | 52 | ||
69 | QByteArray id; | 53 | QByteArray id; |
70 | int type = 0; | 54 | int type = 0; |
diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index ff13783..4ed6e3a 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp | |||
@@ -391,7 +391,7 @@ KAsync::Job<void> Synchronizer::processSyncQueue() | |||
391 | mSyncInProgress = true; | 391 | mSyncInProgress = true; |
392 | }) | 392 | }) |
393 | .then(processRequest(request)) | 393 | .then(processRequest(request)) |
394 | .then<void>([this](const KAsync::Error &error) { | 394 | .then<void>([this, request](const KAsync::Error &error) { |
395 | SinkTraceCtx(mLogCtx) << "Sync request processed"; | 395 | SinkTraceCtx(mLogCtx) << "Sync request processed"; |
396 | mEntityStore->abortTransaction(); | 396 | mEntityStore->abortTransaction(); |
397 | mSyncTransaction.abort(); | 397 | mSyncTransaction.abort(); |
@@ -403,6 +403,7 @@ KAsync::Job<void> Synchronizer::processSyncQueue() | |||
403 | } | 403 | } |
404 | if (error) { | 404 | if (error) { |
405 | SinkWarningCtx(mLogCtx) << "Error during sync: " << error; | 405 | SinkWarningCtx(mLogCtx) << "Error during sync: " << error; |
406 | emitNotification(Notification::Error, error.errorCode, error.errorMessage, request.requestId); | ||
406 | } | 407 | } |
407 | //In case we got more requests meanwhile. | 408 | //In case we got more requests meanwhile. |
408 | return processSyncQueue(); | 409 | return processSyncQueue(); |