Class: RealPage::Validator::RequestErrors
- Inherits:
-
Object
- Object
- RealPage::Validator::RequestErrors
- Defined in:
- lib/real_page/validator/request_errors.rb
Overview
Ensure there are no errors in the wrapped contents of the body.
This validator works on responses that have the following format:
<s:Envelope>
<s:Body>
<actionnameResponse>
<actionnameResult>
<actionnameresponse>
<success>false</success>
<errorcount>1</errorcount>
<errors>
<error>
<severity>Critical</severity>
<errornumber>1</errornumber>
<>something went wrong</errormessage>
<internalerrormessage/>
</error>
</errors>
</actionnameresponse>
</actionnameResult>
</actionnameResponse>
</s:Body>
</s:Envelope>
Instance Method Summary collapse
-
#initialize(response, request_params, request_name) ⇒ RequestErrors
constructor
A new instance of RequestErrors.
- #validate! ⇒ Object
Constructor Details
#initialize(response, request_params, request_name) ⇒ RequestErrors
Returns a new instance of RequestErrors.
41 42 43 44 45 |
# File 'lib/real_page/validator/request_errors.rb', line 41 def initialize(response, request_params, request_name) @response = response @request_params = request_params @request_name = request_name end |
Instance Method Details
#validate! ⇒ Object
49 50 51 52 53 |
# File 'lib/real_page/validator/request_errors.rb', line 49 def validate! return unless error? send_request_error_to_snowflake raise RealPage::Error::BadRequest.new(errors) end |