Class: Urbanairship::Common::Response
- Inherits:
-
Object
- Object
- Urbanairship::Common::Response
- Defined in:
- lib/urbanairship/common.rb
Class Method Summary collapse
-
.check_code(response_code, response) ⇒ Object
Parse Response Codes and trigger appropriate actions.
Class Method Details
.check_code(response_code, response) ⇒ Object
Parse Response Codes and trigger appropriate actions.
143 144 145 146 147 148 149 150 151 |
# File 'lib/urbanairship/common.rb', line 143 def self.check_code(response_code, response) if response_code == 401 raise Unauthorized, 'Client is not authorized to make this request. The authorization credentials are incorrect or missing.' elsif response_code == 403 raise Forbidden, 'Client is forbidden from making this request. The application does not have the proper entitlement to access this feature.' elsif !((200...300).include?(response_code)) raise AirshipFailure.new.from_response(response) end end |