Sha256: a7fba313409154173998990f7a5e0baacb0715584c5366f0815cc2bb4b79ebe4

Contents?: true

Size: 469 Bytes

Versions: 1

Compression:

Stored size: 469 Bytes

Contents

# frozen_string_literal: true

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

1 entries across 1 versions & 1 rubygems

Version Path
koine-attributes-1.2.4 lib/koine/attributes/invalid_attribute_error.rb