From 3a3e964b53193126f8ab09ebef2dc1cb466c6217 Mon Sep 17 00:00:00 2001 From: Vosjedev Date: Sun, 25 Jan 2026 12:20:18 +0100 Subject: Handle file not found properly Signed-off-by: Vosjedev --- src/discord_image_bridge/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/discord_image_bridge/__init__.py b/src/discord_image_bridge/__init__.py index e0a658a..a9afc3f 100644 --- a/src/discord_image_bridge/__init__.py +++ b/src/discord_image_bridge/__init__.py @@ -30,6 +30,9 @@ class Root(object): osname=fsmanager.hash2fname(hash) if not os.path.isfile(osname): ohash, osname=utils.download_uncached(hash) + if not ohash: + cherrypy.response.status=404 + return "File not found" if not ohash.startswith(hash): cherrypy.log("Wrong hash! Expected %s, got %s"%(hash,ohash)) cherrypy.response.status=500 -- cgit