Exception: Craigslist::API::ValidationError

Inherits:
Error
  • Object
show all
Defined in:
lib/craigslist/api/errors.rb

Overview

Raised when a Posting is missing fields the interface requires, caught locally before a request is made.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors) ⇒ ValidationError

Returns a new instance of ValidationError.



19
20
21
22
# File 'lib/craigslist/api/errors.rb', line 19

def initialize(errors)
  @errors = Array(errors)
  super(@errors.join("; "))
end

Instance Attribute Details

#errorsArray<String> (readonly)

Returns every problem found, not just the first.

Returns:

  • (Array<String>)

    every problem found, not just the first



17
18
19
# File 'lib/craigslist/api/errors.rb', line 17

def errors
  @errors
end