mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 11:39:21 +03:00
Set response ErrorCode as iError for easier fetch error handling
This commit is contained in:
parent
a46c0c3b21
commit
11fd6736bb
24 changed files with 145 additions and 253 deletions
|
|
@ -32,11 +32,9 @@ checkResponseError = data => {
|
|||
) {
|
||||
++iJsonErrorCount;
|
||||
}
|
||||
if (window.rl && (data.ClearAuth || data.Logout || 7 < iJsonErrorCount)) {
|
||||
if (data.ClearAuth || data.Logout || 7 < iJsonErrorCount) {
|
||||
rl.hash.clear();
|
||||
if (!data.ClearAuth) {
|
||||
rl.logoutReload();
|
||||
}
|
||||
data.ClearAuth || rl.logoutReload();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -116,10 +114,16 @@ export class AbstractFetchRemote
|
|||
}
|
||||
|
||||
if (!iError && data) {
|
||||
/*
|
||||
if (sAction !== data.Action) {
|
||||
console.log(sAction + ' !== ' + data.Action);
|
||||
}
|
||||
*/
|
||||
if (data.Result) {
|
||||
iJsonErrorCount = iTokenErrorCount = 0;
|
||||
} else {
|
||||
checkResponseError(data);
|
||||
iError = data.ErrorCode || Notification.UnknownError
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue