Sha256: 4ba78efbfac5e3ec2f087fd026f4dcc7f1dc35f793b248857d689d139d41859f

Contents?: true

Size: 926 Bytes

Versions: 14

Compression:

Stored size: 926 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasResult
        module Errors
          class ResultIsNotOverridden < ConvenientService::Error
            def initialize(service:)
              message = <<~TEXT
                Result method (#result) of `#{service.class}` is NOT overridden.
              TEXT

              super(message)
            end
          end

          class ServiceReturnValueNotKindOfResult < ConvenientService::Error
            def initialize(service:, result:)
              message = <<~TEXT
                Return value of service `#{service.class}` is NOT a `Result`.
                It is a `#{result.class}`.

                Did you forget to call `success`, `failure`, or `error` from the `result` method?
              TEXT

              super(message)
            end
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
convenient_service-0.11.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.10.1 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.10.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.9.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.8.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.7.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.6.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.5.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.4.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.3.1 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.3.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.2.1 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.2.0 lib/convenient_service/service/plugins/has_result/errors.rb
convenient_service-0.1.0 lib/convenient_service/service/plugins/has_result/errors.rb