From b1943f8aca14a5ccfa31052350e2eaa5aa43325a Mon Sep 17 00:00:00 2001 From: Wenbin Fang Date: Thu, 10 Mar 2022 11:11:18 -0800 Subject: [PATCH] Update error message for HTTP 429. --- Gemfile.lock | 6 +++--- README.md | 4 ++-- examples/Gemfile.lock | 6 +++--- examples/sample.rb | 2 +- lib/podcast_api.rb | 2 +- lib/version.rb | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e985040..720d34c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - podcast_api (1.1.0) + podcast_api (1.1.1) httparty GEM @@ -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) diff --git a/README.md b/README.md index 77d0105..e5ae9b0 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) | diff --git a/examples/Gemfile.lock b/examples/Gemfile.lock index df72e96..b32c15e 100644 --- a/examples/Gemfile.lock +++ b/examples/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - podcast_api (1.1.0) + podcast_api (1.1.1) httparty GEM @@ -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 diff --git a/examples/sample.rb b/examples/sample.rb index 0d74680..117885e 100644 --- a/examples/sample.rb +++ b/examples/sample.rb @@ -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 diff --git a/lib/podcast_api.rb b/lib/podcast_api.rb index 70c59c3..639e104 100644 --- a/lib/podcast_api.rb +++ b/lib/podcast_api.rb @@ -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 diff --git a/lib/version.rb b/lib/version.rb index 31dd160..bde9397 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module PodcastApi - VERSION = "1.1.0" + VERSION = "1.1.1" end \ No newline at end of file