Skip to content

Commit

Permalink
Add Feedlr::Error::ServiceUnavailableError
Browse files Browse the repository at this point in the history
To support the case below.
cursor=#<Feedlr::Base errorCode=503 errorId="ap7-sv2.2014101600.3589028" errorMessage="too many requests, try again later">
  • Loading branch information
y-ken committed Oct 23, 2014
1 parent 0a0c006 commit a9d46fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/feedlr/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def errors
401 => Feedlr::Error::Unauthorized,
403 => Feedlr::Error::Forbidden,
404 => Feedlr::Error::NotFound,
500 => Feedlr::Error::InternalServerError
500 => Feedlr::Error::InternalServerError,
503 => Feedlr::Error::ServiceUnavailableError
}
end
end
Expand Down Expand Up @@ -49,6 +50,9 @@ class ServerError < self; end
# Raised when Feedlr returns the HTTP status status_code 500
class InternalServerError < ServerError; end

# Raised when Feedlr returns the HTTP status status_code 503
class ServiceUnavailableError < ServerError; end

# Raised when the request times out
class RequestTimeout < self; end
end
Expand Down

0 comments on commit a9d46fd

Please sign in to comment.