Sha256: 62b028748b1c5bbdc73f66b725aad5da98afcec5798bcad72552e100fe845163

Contents?: true

Size: 1.21 KB

Versions: 15

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module HasResultShortSyntax
        module Error
          module Errors
            class BothArgsAndKwargsArePassed < ::ConvenientService::Error
              def initialize
                message = <<~TEXT
                  Both `args` and `kwargs` are passed to the `error` method.

                  Did you mean something like:

                  error("Helpful text")
                  error("Helpful text", :descriptive_code)

                  error(message: "Helpful text")
                  error(message: "Helpful text", code: :descriptive_code)
                TEXT

                super(message)
              end
            end

            class MoreThanTwoArgsArePassed < ::ConvenientService::Error
              def initialize
                message = <<~TEXT
                  More than two `args` are passed to the `error` method.

                  Did you mean something like:

                  error("Helpful text")
                  error("Helpful text", :descriptive_code)
                TEXT

                super(message)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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