Exception: Boltless::Errors::ResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/boltless/errors/response_error.rb

Overview

A generic response error, for everything neo4j want to tell us

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, code: nil, response: nil) ⇒ Errors::RequestError

Create a new generic response error instance.

Parameters:

  • message (String)

    the error message

  • code (String, nil) (defaults to: nil)

    the neo4j error code, or nil when not available

  • response (HTTP::Response, nil) (defaults to: nil)

    the HTTP response, or nil when not available



19
20
21
22
23
24
25
26
27
# File 'lib/boltless/errors/response_error.rb', line 19

def initialize(message, code: nil, response: nil)
  formatted = "#{message} (#{code})" if message && code
  formatted = code unless message
  formatted ||= message
  super(formatted)
  @message = formatted
  @code = code
  @response = response
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/boltless/errors/response_error.rb', line 9

def code
  @code
end

#messageObject

We allow to read our details



8
9
10
# File 'lib/boltless/errors/response_error.rb', line 8

def message
  @message
end

#responseObject (readonly)

Returns the value of attribute response.



9
10
11
# File 'lib/boltless/errors/response_error.rb', line 9

def response
  @response
end