diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 5005b6fca..6cf3aa3a7 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -exuo pipefail +set -euo pipefail FILENAME=$(basename dist/*.whl) @@ -14,11 +14,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(curl -v -X PUT \ +HTTP_CODE=$(curl -w '%{http_code}' -o /dev/null -s -X PUT \ -H "Content-Type: binary/octet-stream" \ - --data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1) + --data-binary "@dist/$FILENAME" "$SIGNED_URL") -if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then +if [[ "$HTTP_CODE" == "200" ]]; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/anthropic-python/$SHA/$FILENAME'\033[0m" else diff --git a/src/anthropic/lib/tools/_beta_runner.py b/src/anthropic/lib/tools/_beta_runner.py index f466c1534..57367a580 100644 --- a/src/anthropic/lib/tools/_beta_runner.py +++ b/src/anthropic/lib/tools/_beta_runner.py @@ -192,7 +192,7 @@ def _generate_tool_call_response(self) -> BetaMessageParam | None: { "type": "tool_result", "tool_use_id": tool_use.id, - "content": repr(exc), + "content": f"Error: Tool '{tool_use.name}' execution failed. Check logs for details.", "is_error": True, } ) @@ -359,7 +359,7 @@ async def _generate_tool_call_response(self) -> BetaMessageParam | None: { "type": "tool_result", "tool_use_id": tool_use.id, - "content": repr(exc), + "content": f"Error: Tool '{tool_use.name}' execution failed. Check logs for details.", "is_error": True, } )