utils/converters: use ValidationError instead of Exception

This ensures that after validation the page is resolved as a 404 instead
of displaying a 500.
This commit is contained in:
Lephe 2021-07-07 15:22:40 +02:00
parent 6cbf5a51f9
commit daadd21877
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 1 additions and 1 deletions

View File

@ -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)