mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
Fix API error detection in fetch_all_open_issues
- Corrected error check to detect GitHub API error objects
- API errors return {message: "..."} not array with message
- All tests still passing
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -86,10 +86,10 @@ fetch_all_open_issues() {
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
"https://api.github.com/repos/$OWNER/$REPO/issues?state=open&per_page=$per_page&page=$page&sort=created&direction=desc")
|
||||
|
||||
# Check for API errors
|
||||
if echo "$response" | jq -e '.[0].message' > /dev/null 2>&1; then
|
||||
# Check for API errors (errors return object with .message, not array)
|
||||
if echo "$response" | jq -e 'select(.message != null) | .message' > /dev/null 2>&1; then
|
||||
local error_msg
|
||||
error_msg=$(echo "$response" | jq -r '.[0].message')
|
||||
error_msg=$(echo "$response" | jq -r '.message')
|
||||
echo "❌ GitHub API error: $error_msg" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user