diff options
Diffstat (limited to 'app/services/solidus_subscriptions/unsubscribable_error.rb')
-rw-r--r-- | app/services/solidus_subscriptions/unsubscribable_error.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/services/solidus_subscriptions/unsubscribable_error.rb b/app/services/solidus_subscriptions/unsubscribable_error.rb new file mode 100644 index 0000000..3785983 --- /dev/null +++ b/app/services/solidus_subscriptions/unsubscribable_error.rb @@ -0,0 +1,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 |