From b133eea89448a8e3ce9b99c3cfafac4885fbfb4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Wed, 28 Sep 2022 15:03:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Initialize=20exception=20with=20?= =?UTF-8?q?provided=20message=20(#4625)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we get actual message when exception happens like: "octoprint.filemanager.storage.StorageError: /tmp/test is not a valid directory" --- src/octoprint/filemanager/storage.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/octoprint/filemanager/storage.py b/src/octoprint/filemanager/storage.py index ef64fc954..e4ae04bdf 100644 --- a/src/octoprint/filemanager/storage.py +++ b/src/octoprint/filemanager/storage.py @@ -445,8 +445,7 @@ class StorageError(Exception): NOT_EMPTY = "not_empty" def __init__(self, message, code=None, cause=None): - BaseException.__init__(self) - self.message = message + Exception.__init__(self, message) self.cause = cause if code is None: