From de121008c1e7e73f61aa81a00de39fe9651888eb Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Sun, 11 Jul 2021 20:58:39 -0400 Subject: [PATCH] fix DoesNotExist exception --- frigate/http.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frigate/http.py b/frigate/http.py index 03903967b..56fe9bad2 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -234,9 +234,9 @@ def event_snapshot(id): def event_clip(id): download = request.args.get("download", type=bool) - event: Event = Event.get(Event.id == id) - - if event is None: + try: + event: Event = Event.get(Event.id == id) + except DoesNotExist: return "Event not found.", 404 if not event.has_clip: @@ -689,9 +689,9 @@ def vod_hour(year_month, day, hour, camera): @bp.route("/vod/event/") def vod_event(id): - event: Event = Event.get(Event.id == id) - - if event is None: + try: + event: Event = Event.get(Event.id == id) + except DoesNotExist: return "Event not found.", 404 if not event.has_clip: