summaryrefslogtreecommitdiff
path: root/app/services/solidus_subscriptions/unsubscribable_error.rb
blob: 3785983f568e8dcf06c16e70c4a83fedba97be9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This error should be raised if a user attempts to subscribe to a item which
# is not subscribable
module SolidusSubscriptions
  class UnsubscribableError < StandardError
    def initialize(subscribable)
      @subscribable = subscribable
      super
    end

    def to_s
      <<-MSG.squish
        #{@subscribable.class} with id: #{@subscribable.id} cannot be
        subscribed to.
      MSG
    end
  end
end