Enhance error messages

This commit is contained in:
AngelBottomless
2025-01-09 02:48:51 +09:00
parent 17b8937cae
commit db84be70ae
+3 -3
View File
@@ -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