Exception: Douban::BadRequest

Inherits:
Error
  • Object
show all
Defined in:
lib/douban_api/error.rb

Overview

Raised when Douban returns the HTTP status code 400

Direct Known Subclasses

NotFound

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ BadRequest

Returns a new instance of BadRequest.



10
11
12
13
# File 'lib/douban_api/error.rb', line 10

def initialize(body)
  @code, @msg = 0, ""
  parse_error_body(body)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/douban_api/error.rb', line 8

def code
  @code
end

#msgObject (readonly)

Returns the value of attribute msg.



8
9
10
# File 'lib/douban_api/error.rb', line 8

def msg
  @msg
end