Skip to content

Commit

Permalink
Remove developer_message support (#1252)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe authored Jul 28, 2023
1 parent 078adfc commit d604af0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion lib/stripe/stripe_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def self.maybe_gc_connection_managers
end

private def specific_api_error(resp, error_data, context)
message = error_data[:message] || error_data[:developer_message]
message = error_data[:message]
Util.log_error("Stripe API error",
status: resp.http_status,
error_code: error_data[:code],
Expand Down
11 changes: 0 additions & 11 deletions test/stripe/preview_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,5 @@ class PreviewTest < Test::Unit::TestCase
assert_equal "application/json", req.headers["Content-Type"]
assert_equal stripe_context, req.headers["Stripe-Context"]
end

should "include developer_message in error message" do
expected_body = "{\"error\": {\"developer_message\": \"Unacceptable!\"}}"
stub_request(:get, "#{Stripe.api_base}/v2/accounts/acc_123")
.to_return(body: expected_body, status: 400)

e = assert_raises do
Stripe::Preview.get("/v2/accounts/acc_123")
end
assert_equal "Unacceptable!", e.message
end
end
end

0 comments on commit d604af0

Please sign in to comment.