core: improve error handling for backups

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-13 17:56:49 +02:00
parent 8362507bdf
commit f9f2e00913
2 changed files with 4 additions and 1 deletions

View file

@ -75,5 +75,6 @@ def backup_database(self: MonitoredTask): # pragma: no cover
Boto3Error, Boto3Error,
PermissionError, PermissionError,
CommandConnectorError, CommandConnectorError,
ValueError,
) as exc: ) as exc:
self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc)) self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc))

View file

@ -4,6 +4,7 @@ from typing import Optional
from aioredis.errors import ConnectionClosedError, ReplyError from aioredis.errors import ConnectionClosedError, ReplyError
from billiard.exceptions import WorkerLostError from billiard.exceptions import WorkerLostError
from botocore.client import ClientError from botocore.client import ClientError
from botocore.exceptions import BotoCoreError
from celery.exceptions import CeleryError from celery.exceptions import CeleryError
from channels.middleware import BaseMiddleware from channels.middleware import BaseMiddleware
from channels_redis.core import ChannelFull from channels_redis.core import ChannelFull
@ -72,6 +73,7 @@ def before_send(event: dict, hint: dict) -> Optional[dict]:
WorkerLostError, WorkerLostError,
CeleryError, CeleryError,
# S3 errors # S3 errors
BotoCoreError,
ClientError, ClientError,
# custom baseclass # custom baseclass
SentryIgnoredException, SentryIgnoredException,
@ -87,6 +89,6 @@ def before_send(event: dict, hint: dict) -> Optional[dict]:
if isinstance(exc_value, ignored_classes): if isinstance(exc_value, ignored_classes):
return None return None
if "logger" in event: if "logger" in event:
if event["logger"] in ["dbbackup"]: if event["logger"] in ["dbbackup", "botocore"]:
return None return None
return event return event