Browse Source

fix: use Exception to handle all errors

arkohut 10 months ago
parent
commit
d20f6cb45b
1 changed files with 2 additions and 7 deletions
  1. 2 7
      backend/config.py

+ 2 - 7
backend/config.py

@@ -308,13 +308,8 @@ frontend_favicon = FRONTEND_BUILD_DIR / "favicon.png"
 if frontend_favicon.exists():
 if frontend_favicon.exists():
     try:
     try:
         shutil.copyfile(frontend_favicon, STATIC_DIR / "favicon.png")
         shutil.copyfile(frontend_favicon, STATIC_DIR / "favicon.png")
-    except PermissionError:
-        logging.error(f"No write permission to {STATIC_DIR / 'favicon.png'}")
-    except OSError as e:
-        if e.errno == 30:  # Read-only file system
-            logging.error(f"Read-only file system: {STATIC_DIR / 'favicon.png'}")
-        else:
-            logging.error(f"OS error occurred: {e}")
+    except Exception as e:
+        logging.error(f"An error occurred: {e}")
 
 
 else:
 else:
     logging.warning(f"Frontend favicon not found at {frontend_favicon}")
     logging.warning(f"Frontend favicon not found at {frontend_favicon}")