lib/active_mocker/mock/exceptions.rb in active_mocker-2.3.0 vs lib/active_mocker/mock/exceptions.rb in active_mocker-2.3.1

- old
+ new

@@ -1,16 +1,18 @@ # frozen_string_literal: true module ActiveMocker - class RecordNotFound < StandardError + class BaseError < StandardError end + class RecordNotFound < BaseError + end module Mock # @deprecated RecordNotFound = ActiveMocker::RecordNotFound end - class IdError < StandardError + class IdError < BaseError end # Raised when unknown attributes are supplied via mass assignment. class UnknownAttributeError < NoMethodError attr_reader :record, :attribute @@ -20,17 +22,20 @@ @attribute = attribute.to_s super("unknown attribute: #{attribute}") end end - class UpdateMocksError < Exception + class UpdateMocksError < BaseError def initialize(name, mock_version, gem_version) super("#{name} was built with #{mock_version} but the gem version is #{gem_version}. Run `rake active_mocker:build` to update.") end end - class NotImplementedError < Exception + class NotImplementedError < BaseError end - class Error < Exception + class Error < BaseError + end + + class MockNotLoaded < BaseError end end