Skip to content

Commit f213c87

Browse files
yeldarbyclaude
andcommitted
fix(cli): add hint for non-image upload errors
When PIL cannot identify an uploaded file, the error now includes a hint listing supported image formats instead of just the raw exception message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 54f055f commit f213c87

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

roboflow/cli/handlers/image.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ def _handle_upload_single(args: argparse.Namespace, api_key: str, path: str) ->
9999
metadata=metadata,
100100
)
101101
except Exception as exc:
102-
output_error(args, str(exc))
102+
msg = str(exc)
103+
hint = None
104+
if "cannot identify image file" in msg:
105+
hint = "Supported formats: JPEG, PNG, BMP, GIF, TIFF, WebP."
106+
output_error(args, msg, hint=hint)
103107
return
104108

105109
data = {"status": "uploaded", "path": path, "project": args.project}

0 commit comments

Comments
 (0)