Exception: Pili::RPCError
- Inherits:
-
Exception
- Object
- Exception
- Pili::RPCError
show all
- Defined in:
- lib/pili/exception.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(message, resp) ⇒ RPCError
Returns a new instance of RPCError.
11
12
13
14
|
# File 'lib/pili/exception.rb', line 11
def initialize(message, resp)
@resp = resp
super(message)
end
|
Instance Attribute Details
#resp ⇒ Object
Returns the value of attribute resp.
9
10
11
|
# File 'lib/pili/exception.rb', line 9
def resp
@resp
end
|
Instance Method Details
#code ⇒ Object
16
17
18
|
# File 'lib/pili/exception.rb', line 16
def code
resp.code
end
|
#message ⇒ Object
24
25
26
|
# File 'lib/pili/exception.rb', line 24
def message
to_s
end
|
#reqid ⇒ Object
20
21
22
|
# File 'lib/pili/exception.rb', line 20
def reqid
resp["X-Reqid"]
end
|
#to_s ⇒ Object
28
29
30
|
# File 'lib/pili/exception.rb', line 28
def to_s
"#{super.to_s}: #{@resp.body}"
end
|