From 235af9e55859580c75c54cbb5ce46ad413f5f87f Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 22 Feb 2024 13:31:49 +0800 Subject: [PATCH] fix bug --- app/api/endpoints/system.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/api/endpoints/system.py b/app/api/endpoints/system.py index 3a80b672..17ef2b83 100644 --- a/app/api/endpoints/system.py +++ b/app/api/endpoints/system.py @@ -187,6 +187,8 @@ def get_logging(token: str, length: int = 50, logfile: str = "moviepilot.log"): # 根据length参数返回不同的响应 if length == -1: # 返回全部日志作为文本响应 + if not log_path.exists(): + return Response(content="日志文件不存在!", media_type="text/plain") with open(log_path, 'r', encoding='utf-8') as file: text = file.read() return Response(content=text, media_type="text/plain")