Fix error transformer to return instead of raise

The default_error_transformer should return the error object,
not raise it. The with_provider_response wrapper handles the
error and wraps it in a Response object.

Co-authored-by: jjmata <187772+jjmata@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-26 07:08:00 +00:00
parent 9f6291ee40
commit 265458b94f

View File

@@ -239,10 +239,10 @@ class Provider::TwelveData < Provider
response_body = error.response&.dig(:body)
status_code = error.response&.dig(:status)
# Detect 429 rate limit errors
# Detect 429 rate limit errors and return RateLimitError
if status_code == 429
message = extract_error_message(response_body) || error.message
raise RateLimitError.new(
return RateLimitError.new(
"TwelveData rate limit exceeded: #{message}",
details: response_body
)