Exception: Passwordstate::HTTPError

Inherits:
PasswordstateError show all
Defined in:
lib/passwordstate/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, errors = []) ⇒ HTTPError



7
8
9
10
11
12
13
14
15
# File 'lib/passwordstate/errors.rb', line 7

def initialize(code, errors = [])
  @code = code.to_i
  @errors = errors

  super <<-ERRMSG
Passwordstate responded with an error to the request;
#{errors.map { |err| err['message'] || err['phrase'] }.join(', ')}
ERRMSG
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/passwordstate/errors.rb', line 5

def code
  @code
end

#errorsObject (readonly)

Returns the value of attribute errors.



5
6
7
# File 'lib/passwordstate/errors.rb', line 5

def errors
  @errors
end