lib/active_remote/errors.rb in active_remote-1.8.0 vs lib/active_remote/errors.rb in active_remote-1.8.1

- old
+ new

@@ -13,9 +13,21 @@ end # Raised by ActiveRemove::Base.find when remote record is not found when # searching with the given arguments. class RemoteRecordNotFound < ActiveRemoteError + attr_accessor :remote_record_class + + def initialize(class_or_message = "") + message = class_or_message + + if class_or_message.is_a?(Class) + self.remote_record_class = class_or_message + message = "#{remote_record_class} does not exist" + end + + super(message) + end end # Raised by ActiveRemove::Base.save! and ActiveRemote::Base.create! methods # when remote record cannot be saved because it is invalid. class RemoteRecordNotSaved < ActiveRemoteError