Skip to content
Merged
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
2 changes: 1 addition & 1 deletion lib/castle/core/process_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module ProcessResponse
403 => Castle::ForbiddenError,
404 => Castle::NotFoundError,
419 => Castle::UserUnauthorizedError,
429 => Castle::TooManyRequestsError
429 => Castle::RateLimitError
}.freeze

INVALID_REQUEST_TOKEN = 'invalid_request_token'
Expand Down
2 changes: 1 addition & 1 deletion lib/castle/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class UnauthorizedError < Castle::ApiError
end

# api error too many requests 429
class TooManyRequestsError < Castle::ApiError
class RateLimitError < Castle::ApiError
end

# all internal server errors
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/castle/core/process_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
it_behaves_like 'response_failed', '404', Castle::NotFoundError
it_behaves_like 'response_failed', '419', Castle::UserUnauthorizedError
it_behaves_like 'response_failed', '422', Castle::InvalidParametersError
it_behaves_like 'response_failed', '429', Castle::TooManyRequestsError
it_behaves_like 'response_failed', '429', Castle::RateLimitError
it_behaves_like 'response_failed', '499', Castle::ApiError
it_behaves_like 'response_failed', '500', Castle::InternalServerError
end
Expand Down