Skip to content

Commit 50c8fd0

Browse files
committed
improving error message
1 parent 349159d commit 50c8fd0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

alephclient/api.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,15 @@ def signed_url_upload(
549549
try:
550550
# Step 1: request a signed upload URL
551551
upload_url = self._make_url("file/uploadUrl")
552-
result = self._request("POST", upload_url)
552+
try:
553+
result = self._request("POST", upload_url)
554+
except AlephException as ae:
555+
if ae.status == 404:
556+
raise AlephException(
557+
"Upload endpoint not found. "
558+
"Is this an Aleph Pro instance?"
559+
) from ae
560+
raise
553561
signed_url = result["url"]
554562
upload_id = result["id"]
555563
log.info("Signed URL id [%s]: %s", upload_id, file_path.name)

0 commit comments

Comments
 (0)