Hide all non-TaskError exceptions from users

This commit is contained in:
rubenwardy
2018-05-14 01:20:02 +01:00
parent 73fa5d1186
commit e6a3836aab
5 changed files with 20 additions and 12 deletions

View File

@@ -4,6 +4,12 @@ from celery import Celery
from app import app
from app.models import *
class TaskError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr("TaskError: " + self.value)
class FlaskCelery(Celery):
def __init__(self, *args, **kwargs):
super(FlaskCelery, self).__init__(*args, **kwargs)