Sha256: a9f29af636bc1d85647094fd969ac47477ea907eb6b249a27b8bda34e6ef7d39

Contents?: true

Size: 438 Bytes

Versions: 4

Compression:

Stored size: 438 Bytes

Contents

module Koine
  module Attributes
    class InvalidAttributeError < ::ArgumentError
      attr_reader :attribute_name

      def initialize(error, attribute_name)
        @attribute_name = attribute_name

        if error.is_a?(Exception)
          set_backtrace(error.backtrace)
          error = error.message
        end

        error = "#{attribute_name}: #{error}" if attribute_name

        super(error)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
koine-attributes-1.2.3 lib/koine/attributes/invalid_attribute_error.rb
koine-attributes-1.2.2 lib/koine/attributes/invalid_attribute_error.rb
koine-attributes-1.2.1 lib/koine/attributes/invalid_attribute_error.rb
koine-attributes-1.2.0 lib/koine/attributes/invalid_attribute_error.rb