class ActiveFedora::RecordInvalid
end
puts invalid.record.errors
rescue ActiveFedora::RecordInvalid => invalid
complex_operation_that_calls_save!_internally
beginrecord
method to retrieve the record which did not validate.
Raised by save!
and create!
when the record is invalid. Use the
= Active Fedora RecordInvalid, adapted from Active Record
def initialize(record)
def initialize(record) @record = record errors = @record.errors.full_messages.join(", ") super(I18n.t("activefedora.errors.messages.record_invalid", errors: errors)) end