Sha256: f11f2401152b42027373da249e23be73d40150327965a60a28d8453fe76d6a68

Contents?: true

Size: 1.15 KB

Versions: 29

Compression:

Stored size: 1.15 KB

Contents

module Protobuf
  module ActiveRecord
    # = Protobuf Active Record errors
    #
    # Generic Protobuf Active Record exception class
    class ProtobufActiveRecordError < StandardError
    end

    # Raised by `attribute_from_proto` when the transformer method
    # given is not callable.
    class AttributeTransformerError < ProtobufActiveRecordError
      def message
        "Attribute transformers must be called with a callable or block!"
      end
    end

    # Raised by `field_from_record` when the convert method
    # given not callable.
    class FieldTransformerError < ProtobufActiveRecordError
      def message
        "Field transformers must be called with a callable or block!"
      end
    end

    # Raised by `to_proto` when no protobuf message is defined.
    class MessageNotDefined < ProtobufActiveRecordError
      attr_reader :class_name

      def initialize(klass)
        @class_name = klass.name
      end

      def message
        "#{class_name} does not define a protobuf message"
      end
    end

    # Raised by `field_scope` when given scope is not defined.
    class SearchScopeError < ProtobufActiveRecordError
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
protobuf-activerecord-3.4.4 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.4.4.pre lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.4.3 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.4.2 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.4.1 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.4.0 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.8 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.7 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.6 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.5 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.4 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.3 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.2 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.1 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.3.0 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.2.2 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.2.1 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.2.0 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.1.1 lib/protobuf/active_record/errors.rb
protobuf-activerecord-3.1.0 lib/protobuf/active_record/errors.rb