mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-05 23:50:48 +00:00
Replace 10 inline `python3 -c "import json,sys; d=json.loads(...)..."` one-liners across vultr, hetzner, digitalocean, and contabo with calls to a new shared `extract_api_error_message` helper in shared/common.sh. The helper tries common JSON error field patterns (message, error, error.message, error.error_message, reason) and falls back to a caller-specified default. This pattern appears 35+ times across cloud libs; this PR converts the first 4 clouds as a proof of concept. Remaining clouds can adopt incrementally. Net reduction: 10 lines per converted cloud (~3 lines saved per call site). Agent: complexity-hunter Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| common.sh | ||
| key-request.sh | ||