aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/exception.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-09-16 02:12:56 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-09-16 02:12:56 -0400
commit12b64cf1aff9cbe17b15aeb9464ef76a773fde1d (patch)
treee3b880c987f94a208a6e9f3d2f3f9ad16d41148c /gallery_dl/exception.py
parent65ba54beaeb6e72364c33b0bf060267d86271239 (diff)
parent3b7f8716690b7aa1994a9cb387bbc7215e01a4ed (diff)
Update upstream source from tag 'upstream/1.30.7'
Update to upstream version '1.30.7' with Debian dir a74b37bdeb92ab9f3d327de717e2b5cc6d11a25f
Diffstat (limited to 'gallery_dl/exception.py')
-rw-r--r--gallery_dl/exception.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/gallery_dl/exception.py b/gallery_dl/exception.py
index 6adda0d..559fdd1 100644
--- a/gallery_dl/exception.py
+++ b/gallery_dl/exception.py
@@ -104,13 +104,16 @@ class AuthRequired(AuthorizationError):
if auth:
if not isinstance(auth, str):
auth = " or ".join(auth)
- if " " not in resource:
- resource = "this " + resource
- if message is None:
- message = (f"{auth} needed to access {resource}")
+
+ if resource:
+ if " " not in resource:
+ resource = f"this {resource}"
+ resource = f" to access {resource}"
else:
- message = (f"{auth} needed to access {resource} "
- f"('{message}')")
+ resource = ""
+
+ message = f" ('{message}')" if message else ""
+ message = f"{auth} needed{resource}{message}"
AuthorizationError.__init__(self, message)