Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix specs to use api_error_struct instead of struct #150

Merged
merged 1 commit into from
Nov 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/stripe.ex
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ defmodule Stripe do
@doc """
A low level utility function to make an OAuth request to the Stripe API
"""
@spec oauth_request(method, String.t, map) :: {:ok, map} | {:error, struct}
@spec oauth_request(method, String.t, map) :: {:ok, map} | {:error, api_error_struct}
def oauth_request(method, endpoint, body) do
base_url = "https://connect.stripe.com/oauth/"
req_url = base_url <> endpoint
Expand All @@ -323,7 +323,7 @@ defmodule Stripe do
|> handle_response()
end

@spec handle_response(http_success | http_failure) :: {:ok, map} | {:error, struct}
@spec handle_response(http_success | http_failure) :: {:ok, map} | {:error, api_error_struct}
defp handle_response({:ok, status, _headers, body}) when status in 200..299 do
decoded_body = Poison.decode!(body)

Expand Down