lib/eversys/base.rb
# Check to see if the response contains an error and raise an error if
# required
#
# @param response [Net::HTTPResponse]
#
Check to see if the response contains an error and raise an error if
required
Check to see if the response contains an error and raise an error if required
def handle_error(response:)
      if response.code == "401"
        raise Eversys::AuthenticationError.new("AuthenticationError", response)
      end
      if response.code == "429"
        raise Eversys::RateLimitError.new("Rate Limited", response)
      end
      if ["400", "500"].include?(response.code)
        raise Eversys::ServiceError.new("Service Error", response)
      end
      unless ["200", "201", "202", "203", "204"].include?(response.code)
        raise Eversys::ServiceUnavailableError.new("Unknown Error", response)
      end
    end
def handle_error ( response : ) if response . code == "401" raise Eversys :: AuthenticationError . new ( "AuthenticationError" , response ) end if response . code == "429" raise Eversys :: RateLimitError . new ( "Rate Limited" , response ) end if [ "400" , "500" ] . include? ( response . code ) raise Eversys :: ServiceError . new ( "Service Error" , response ) end unless [ "200" , "201" , "202" , "203" , "204" ] . include? ( response . code ) raise Eversys :: ServiceUnavailableError . new ( "Unknown Error" , response ) end end
Check to see if the response contains an error and raise an error if
required
Check to see if the response contains an error and raise an error if required
response
<not_specific>
<not_specific>
None