From dce277f1da8f9a14e6db47d68a471ca4d85b24ba Mon Sep 17 00:00:00 2001 From: gilesb Date: Mon, 12 Jan 2026 08:30:11 +0000 Subject: [PATCH] Show detailed error message on upload failure Co-Authored-By: Claude Opus 4.5 --- artdag.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/artdag.py b/artdag.py index b1e16fa..bb8387a 100755 --- a/artdag.py +++ b/artdag.py @@ -534,7 +534,13 @@ def upload(filepath): if resp.status_code == 401: click.echo("Authentication failed. Please login again.", err=True) sys.exit(1) - resp.raise_for_status() + if resp.status_code >= 400: + try: + detail = resp.json().get("detail", resp.text) + except: + detail = resp.text + click.echo(f"Upload failed: {resp.status_code} - {detail}", err=True) + sys.exit(1) result = resp.json() click.echo(f"CID: {result['cid']}") click.echo(f"Size: {result['size']} bytes")