From db243d050e78e8e21f215df5f4b81fd0cf08a803 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Mon, 1 Jul 2024 15:47:37 +0800 Subject: [PATCH] fix: playbook FileNotFoundError --- apps/ops/api/playbook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ops/api/playbook.py b/apps/ops/api/playbook.py index 38e18bdfb..92290720f 100644 --- a/apps/ops/api/playbook.py +++ b/apps/ops/api/playbook.py @@ -94,7 +94,7 @@ class PlaybookFileBrowserAPIView(APIView): content = f.read() except UnicodeDecodeError: content = _('Unsupported file content') - except SuspiciousFileOperation: + except (SuspiciousFileOperation, FileNotFoundError): raise JMSException(code='invalid_file_path', detail={"msg": _("Invalid file path")}) return Response({'content': content}) else: