Exception: Shikimori::API::BadRequestError

Inherits:
RequestError
  • Object
show all
Defined in:
lib/shikimori/api/errors.rb

Overview

Error, when request is bad

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ BadRequestError

Returns a new instance of BadRequestError.



14
15
16
17
18
# File 'lib/shikimori/api/errors.rb', line 14

def initialize(errors)
  @errors = errors.is_a?(Hash) ? errors['errors'] : errors

  super("Bad request. Errors:\n\t#{@errors.join("\n\t")}")
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



12
13
14
# File 'lib/shikimori/api/errors.rb', line 12

def errors
  @errors
end