mirror of
https://github.com/open-webui/open-webui
synced 2025-06-04 03:37:35 +00:00
fix: use Exception to handle all errors
This commit is contained in:
parent
8e9e429a91
commit
d20f6cb45b
@ -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:
|
except Exception as e:
|
||||||
logging.error(f"No write permission to {STATIC_DIR / 'favicon.png'}")
|
logging.error(f"An error occurred: {e}")
|
||||||
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}")
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logging.warning(f"Frontend favicon not found at {frontend_favicon}")
|
logging.warning(f"Frontend favicon not found at {frontend_favicon}")
|
||||||
|
Loading…
Reference in New Issue
Block a user