Exception: OpencBot::RecordInvalid
- Inherits:
-
OpencBotError
- Object
- StandardError
- OpencBotError
- OpencBot::RecordInvalid
- 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
-
#validation_errors ⇒ Object
readonly
Returns the value of attribute validation_errors.
Instance Method Summary collapse
-
#initialize(validation_errors) ⇒ RecordInvalid
constructor
A new instance of RecordInvalid.
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 = "Validation failed:" + validation_errors.collect{ |e| e[:message] }.join("\n") super() end |
Instance Attribute Details
#validation_errors ⇒ Object (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 |