Opus finding
API error responses that are non-JSON crash jq parsing and surface generic curl_failed
lowbugmedium
- scripts/postprocess-admanage-create.sh:100-108
If the API returns HTML or a plain string (e.g., 502 gateway HTML, plaintext rate-limit body), curl returns 0 but jq fails with parse error; success defaults via // false won't apply because jq exits non-zero before producing output. Without -e, success may be empty, then the !="true" branch is taken, but the subsequent `jq --argjson resp "$resp"` will hard-fail because $resp is not valid JSON, killing that iteration's logging. Bash continues to next file under set -uo pipefail (no -e), but no result file is written and the input is not moved.
Recommendation
Validate response is JSON (e.g., `if ! echo "$resp" | jq -e . >/dev/null; then resp='{"success":false,"error":"non_json_response"}'; fi`) before --argjson usage.