From daadd21877a1e87a17982010e67230c7debecebd Mon Sep 17 00:00:00 2001 From: Lephe Date: Wed, 7 Jul 2021 15:22:40 +0200 Subject: [PATCH] utils/converters: use ValidationError instead of Exception This ensures that after validation the page is resolved as a 404 instead of displaying a 500. --- app/utils/converters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/converters.py b/app/utils/converters.py index 3caae7b..e887f9b 100644 --- a/app/utils/converters.py +++ b/app/utils/converters.py @@ -63,7 +63,7 @@ class PageConverter(BaseConverter): t = self.object.query.filter_by(id=tid).first() if t is None: - raise Exception(f"BaseConverter: no object with id {url}") + raise ValidationError(f"BaseConverter: no object with id {url}") return (t, page)