fix: fallback на raw body при пустом _emsg в проверке RESOURCE_EXHAUSTED

Если python3 недоступен или JSON не парсится, _emsg пустой.
Теперь grep проверяет сырое тело ответа как запасной вариант.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 15:12:15 +07:00
parent 65c15b97bc
commit 3647eba494

View File

@@ -305,7 +305,7 @@ _handle_api_response() {
;;
400)
_emsg=$(_claude_extract_error "$body")
if echo "$_emsg" | grep -qi "RESOURCE_EXHAUSTED"; then
if echo "${_emsg:-$body}" | grep -qi "RESOURCE_EXHAUSTED"; then
echo ""
echo -e "\033[0;33m[КВОТА ИСЧЕРПАНА]\033[0m Лимит запросов исчерпан."
[ -n "$topup_url" ] && echo " $topup_url"