mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
don't pop up network errors for media sync
log them instead
This commit is contained in:
parent
f429986246
commit
f889616ef1
1 changed files with 6 additions and 1 deletions
|
@ -11,7 +11,8 @@ from typing import List, Union
|
||||||
import aqt
|
import aqt
|
||||||
from anki import hooks
|
from anki import hooks
|
||||||
from anki.consts import SYNC_BASE
|
from anki.consts import SYNC_BASE
|
||||||
from anki.rsbackend import TR, Interrupted, MediaSyncProgress, Progress, ProgressKind
|
from anki.rsbackend import TR, Interrupted, MediaSyncProgress, Progress, \
|
||||||
|
ProgressKind, NetworkError
|
||||||
from anki.types import assert_impossible
|
from anki.types import assert_impossible
|
||||||
from anki.utils import intTime
|
from anki.utils import intTime
|
||||||
from aqt import gui_hooks
|
from aqt import gui_hooks
|
||||||
|
@ -100,6 +101,10 @@ class MediaSyncer:
|
||||||
if isinstance(exc, Interrupted):
|
if isinstance(exc, Interrupted):
|
||||||
self._log_and_notify(tr(TR.SYNC_MEDIA_ABORTED))
|
self._log_and_notify(tr(TR.SYNC_MEDIA_ABORTED))
|
||||||
return
|
return
|
||||||
|
elif isinstance(exc, NetworkError):
|
||||||
|
# avoid popups for network errors
|
||||||
|
self._log_and_notify(str(exc))
|
||||||
|
return
|
||||||
|
|
||||||
self._log_and_notify(tr(TR.SYNC_MEDIA_FAILED))
|
self._log_and_notify(tr(TR.SYNC_MEDIA_FAILED))
|
||||||
showWarning(str(exc))
|
showWarning(str(exc))
|
||||||
|
|
Loading…
Reference in a new issue