lib/neutrino/gateway/responses/response_handler.rb
# Returns the result of the ResponseHandler block unless the exception arguments match
# @param exception_code [String] exception code
# @param exception_regexp [Regexp] regular expression matching the exception message
# @param exception [Exception] exception to raise
# @return [Responses::ResponseHandler] the http response that was passed to the method
# @raise [Exception] if the exception_code and exception_message match
Returns the result of the ResponseHandler block unless the exception arguments match
Returns the result of the ResponseHandler block unless the exception arguments match
def with_general_exception_check(exception_code, exception_regexp, exception)
          if @response.code == exception_code && exception_regexp.match(JSON.parse(@response.body)['error'])
            raise(exception)
          else
            self
          end
        rescue JSON::ParserError
          self
        end
def with_general_exception_check ( exception_code , exception_regexp , exception ) if @response . code == exception_code && exception_regexp . match ( JSON . parse ( @response . body ) [ 'error' ] ) raise ( exception ) else self end rescue JSON :: ParserError self end
Returns the result of the ResponseHandler block unless the exception arguments match
Returns the result of the ResponseHandler block unless the exception arguments match
the http response that was passed to the method
the http response that was passed to the method
Responses::ResponseHandler
[Exception] if the exception_code and exception_message match
[ Exception ] if the exception_code and exception_message match
exception_code
None
exception_regexp
regular expression matching the exception message
regular expression matching the exception message
exception
exception to raise
exception to raise