lib/convenient_service/support/castable/exceptions.rb in convenient_service-0.16.0 vs lib/convenient_service/support/castable/exceptions.rb in convenient_service-0.17.0

- old
+ new

@@ -3,25 +3,25 @@ module ConvenientService module Support module Castable module Exceptions class CastIsNotOverridden < ::ConvenientService::Exception - def initialize(klass:) + def initialize_with_kwargs(klass:) message = <<~TEXT Cast method (.cast) of `#{klass}` is NOT overridden. TEXT - super(message) + initialize(message) end end class FailedToCast < ::ConvenientService::Exception - def initialize(other:, klass:) + def initialize_with_kwargs(other:, klass:) message = <<~TEXT Failed to cast `#{other.inspect}` into `#{klass}`. TEXT - super(message) + initialize(message) end end end end end