Sha256: ed9604606b8384de725cdac0fcce6eea03ad034215c3079be0fe0cd5b994cb4c
Contents?: true
Size: 1.61 KB
Versions: 2
Compression:
Stored size: 1.61 KB
Contents
# frozen_string_literal: true module ConvenientService module Service module Plugins module CanHaveFallbacks module Exceptions class FallbackResultIsNotOverridden < ::ConvenientService::Exception def initialize_with_kwargs(service:, status:) message = <<~TEXT Fallback#{enclose(status, " ")}result method (#fallback#{enclose(status, "_")}result) of `#{service.class}` is NOT overridden. NOTE: Make sure overridden `fallback#{enclose(status, "_")}result` returns `success` with reasonable "null" data. TEXT initialize(message) end private ## # @return [String] # def enclose(...) ConvenientService::Utils::String.enclose(...) end end class ServiceFallbackReturnValueNotSuccess < ::ConvenientService::Exception def initialize_with_kwargs(service:, result:, status:) message = <<~TEXT Return value of service `#{service.class}`#{enclose(status, " ")}fallback is NOT a `success`. It is `#{result.status}`. Did you accidentally call `failure` or `error` instead of `success` from the `fallback#{enclose(status, "_")}result` method? TEXT initialize(message) end private ## # @return [String] # def enclose(...) ConvenientService::Utils::String.enclose(...) end end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems