Repository navigation
fix(errors): surface the history-gate 402 upgrade link in SDK and CLI - #164
Conversation
… (api#10744) The UPGRADE_REQUIRED 402 sends its link as upgrade.url, with no top-level upgrade_url, so PaymentRequiredError.remediation_url was None. From 2026-11-16 /v1/prices/historical and /history join that gate. - error_from_response falls back to upgrade.url for remediation_url - oilprice historical prints the upgrade link (unwrapped) and the latest-price command that still works on a 402/403 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
A quota 402 (free_tier_quota_exceeded) also refuses /v1/prices/latest, so the hint was false there. Show it only for UPGRADE_REQUIRED; the upgrade link still prints for any 402/403 that sends one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed 1306341: Finding: Test (Python 3.8/3.9) will still fail until #166 merges (#165). This head needs a fresh review; I authored this commit, so I am not posting a verdict. |
|
Adversarial review: APPROVE.
Rebase after #166 for a green 3.8/3.9 run before merging is recommended. |
Fixes #163 (code part).
The UPGRADE_REQUIRED 402 sends its link as
upgrade.url; there is no top-levelupgrade_url, soPaymentRequiredError.remediation_urlwasNone. From 2026-11-16/v1/prices/historicaland/historyjoin that gate (api#10744).remediation_urlfalls back toupgrade.urloilpriceapi/exceptions.pyoilprice historicalprints the upgrade link (unwrapped) and the latest-price command on 402/403oilpriceapi/cli.pytests/unit/test_history_gate_402.pyTests: new file red on origin/main (2 failed), green with fix.
tests/unit1905 passed; 24 failures aretest_streaming*needingwebsockets, not installed locally, unrelated.Not done: PyPI publish of 1.18.0 (release step).
🤖 Generated with Claude Code