Exception: OpencBot::RecordInvalid

Inherits:
OpencBotError show all
Defined in:
lib/openc_bot/exceptions.rb

Overview

Raised by save_entity! when the record is invalid. Use the validation_errors method to retrieve the, er, validation errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(validation_errors) ⇒ RecordInvalid

Returns a new instance of RecordInvalid.



12
13
14
15
16
# File 'lib/openc_bot/exceptions.rb', line 12

def initialize(validation_errors)
  @validation_errors = validation_errors
  message = "Validation failed:" + validation_errors.collect{ |e| e[:message] }.join("\n")
  super(message)
end

Instance Attribute Details

#validation_errorsObject (readonly)

Returns the value of attribute validation_errors.



10
11
12
# File 'lib/openc_bot/exceptions.rb', line 10

def validation_errors
  @validation_errors
end