Exception: Riakpb::FailedRequest

Inherits:
StandardError
  • Object
show all
Includes:
Util::Translation
Defined in:
lib/riakpb/failed_request.rb

Overview

Exception raised when the expected response code from Riakpb fails to match the actual response code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util::Translation

#i18n_scope, #t

Constructor Details

#initialize(expected = nil, actual = nil, output = nil, message = nil) ⇒ FailedRequest

Returns a new instance of FailedRequest.



14
15
16
17
18
19
20
# File 'lib/riakpb/failed_request.rb', line 14

def initialize(expected=nil, actual=nil, output=nil, message=nil)
  @expected = expected
  @actual   = actual
  @output   = output
  @message  = message || "failed_request"
  super t(@message, :expected => @expected, :actual => @actual, :output => @output.inspect)
end

Instance Attribute Details

#actualObject (readonly)

Returns the value of attribute actual.



10
11
12
# File 'lib/riakpb/failed_request.rb', line 10

def actual
  @actual
end

#expectedObject (readonly)

Returns the value of attribute expected.



9
10
11
# File 'lib/riakpb/failed_request.rb', line 9

def expected
  @expected
end

#messageObject (readonly)

Returns the value of attribute message.



12
13
14
# File 'lib/riakpb/failed_request.rb', line 12

def message
  @message
end

#outputObject (readonly)

Returns the value of attribute output.



11
12
13
# File 'lib/riakpb/failed_request.rb', line 11

def output
  @output
end