Skip to content
Open
Show file tree
Hide file tree
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: 4 additions & 0 deletions lib/plivo/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ def handle_response_exceptions(response)
Exceptions::InvalidRequestError,
'Unprocessable Entity'
],
429 => [
Exceptions::TooManyRequestsError,
'Too many requests'
],
500 => [
Exceptions::PlivoServerError,
'A server error occurred while accessing resource'
Expand Down
6 changes: 6 additions & 0 deletions lib/plivo/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@ module Exceptions
##
# This will be raised when there is an authentication error
ResourceNotFoundError = Class.new(PlivoRESTError)

##
# This will be raised when the API calls to the server reach their limit.
#
# Usually, the reason why this error is raised will be included.
TooManyRequestsError = Class.new(PlivoRESTError)
end
end