From db84be70ae7929991bf6fee0792e027dabfc4bd2 Mon Sep 17 00:00:00 2001 From: AngelBottomless Date: Thu, 9 Jan 2025 02:48:51 +0900 Subject: [PATCH] Enhance error messages --- io_node.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/io_node.py b/io_node.py index 8f6cbe3..3a88508 100644 --- a/io_node.py +++ b/io_node.py @@ -145,9 +145,9 @@ class ParseExifNode: def throw_if_parent_or_root_access(path): if ".." in path or path.startswith("/") or path.startswith("\\"): - raise RuntimeError("Invalid path") + raise RuntimeError("Tried to access parent or root directory") if path.startswith("~"): - raise RuntimeError("Invalid path") + raise RuntimeError("Tried to access home directory") if os.path.isabs(path): raise RuntimeError("Path cannot be absolute") @@ -579,7 +579,7 @@ class ImageFromURLNode: @PILHandlingHodes.output_wrapper def url_download(url): if not url.startswith("http"): # for security reasons - raise RuntimeError("Invalid URL") + raise RuntimeError("Strict URL check is required, however the URL does not start with http") image = PILHandlingHodes.handle_input(url) # automatically downloads image return (image,) @classmethod