Skip to content

Commit

Permalink
Merge branch 'main' into add-manual-mapping-of-operations
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis authored Aug 22, 2024
2 parents fae16e4 + 50ff9fc commit f3814f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/stripe/api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,13 @@ defmodule Stripe.API do
end

defp do_perform_request_and_retry(method, url, headers, body, opts, {:attempts, attempts}) do
start_metadata = %{url: url, method: method, attempts: attempts, headers: headers}

response =
:telemetry.span(~w[stripe request]a, %{url: url, method: method}, fn ->
:telemetry.span(~w[stripe request]a, start_metadata, fn ->
case http_module().request(method, url, Map.to_list(headers), body, opts) do
{:ok, status, _, _} = resp ->
{resp, %{status: status}}
{resp, Map.merge(start_metadata, %{status: status})}

error ->
{error, %{}}
Expand Down

0 comments on commit f3814f9

Please sign in to comment.