Skip to content

Commit

Permalink
Update error message for HTTP 429.
Browse files Browse the repository at this point in the history
  • Loading branch information
wenbinf committed Mar 10, 2022
1 parent 6fafa18 commit b1943f8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
podcast_api (1.1.0)
podcast_api (1.1.1)
httparty

GEM
Expand All @@ -10,9 +10,9 @@ GEM
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
mime-types (3.3.1)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0901)
mime-types-data (3.2022.0105)
mocha (1.12.0)
multi_xml (0.6.0)
power_assert (2.0.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ rescue PodcastApi::InvalidRequestError
rescue PodcastApi::NotFoundError
puts 'Not found'
rescue PodcastApi::RateLimitError
puts 'Reached quota limit'
puts 'Reached quota limit or rate limit'
rescue PodcastApi::APIConnectionError
puts 'Failed to connect to Listen API servers'
rescue PodcastApi::PodcastApiError
Expand All @@ -105,7 +105,7 @@ the sort of error that occurred.
| AuthenticationError | wrong api key or your account is suspended |
| APIConnectionError | fail to connect to API servers |
| InvalidRequestError | something wrong on your end (client side errors), e.g., missing required parameters |
| RateLimitError | you are using FREE plan and you exceed the quota limit |
| RateLimitError | for FREE plan, exceeding the quota limit; or for all plans, sending too many requests too fast and exceeding the rate limit |
| NotFoundError | endpoint not exist, or podcast / episode not exist |
| PodcastApiError | something wrong on our end (unexpected server errors) |

Expand Down
6 changes: 3 additions & 3 deletions examples/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
podcast_api (1.1.0)
podcast_api (1.1.1)
httparty

GEM
Expand All @@ -10,9 +10,9 @@ GEM
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
mime-types (3.3.1)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0901)
mime-types-data (3.2022.0105)
multi_xml (0.6.0)

PLATFORMS
Expand Down
2 changes: 1 addition & 1 deletion examples/sample.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
rescue PodcastApi::NotFoundError
puts 'Not found'
rescue PodcastApi::RateLimitError
puts 'Reached quota limit'
puts 'Reached quota limit or rate limit'
rescue PodcastApi::APIConnectionError
puts 'Failed to connect to Listen API servers'
rescue PodcastApi::PodcastApiError
Expand Down
2 changes: 1 addition & 1 deletion lib/podcast_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def get_response(response:)
elsif response.code == 404
raise NotFoundError.new 'endpoint not exist, or podcast / episode not exist'
elsif response.code == 429
raise RateLimitError.new 'you are using FREE plan and you exceed the quota limit'
raise RateLimitError.new 'for FREE plan, exceeding the quota limit; or for all plans, sending too many requests too fast and exceeding the rate limit - https://www.listennotes.com/api/faq/#faq17'
else
raise PodcastApiError.new 'something wrong on our end (unexpected server errors)'
end
Expand Down
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module PodcastApi
VERSION = "1.1.0"
VERSION = "1.1.1"
end

0 comments on commit b1943f8

Please sign in to comment.