Sha256: 71b1567e9ea2b0f9c06b581fbe0e477639dd3ee479800461785b9b4714c31d17

Contents?: true

Size: 755 Bytes

Versions: 6

Compression:

Stored size: 755 Bytes

Contents

require "i18n"

module Shamu

  module Services
    # A generic error class for problems with shamu services.
    class Error < Shamu::Error
      private

        def translation_scope
          super.dup.insert( 1, :services )
        end

    end

    # The service has included a module that requires some setup or
    # configuration but it hasn't been setup properly.
    class IncompleteSetupError < Error
      def initialize( message = :incomplete_setup )
        super
      end
    end

    class ServiceRequestFailedError < Error
      attr_reader :result

      def initialize( result )
        @result = result

        super translate( :service_request_failed, errors: result.errors.full_messages.join( ", " ) )
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shamu-0.0.19 lib/shamu/services/error.rb
shamu-0.0.18 lib/shamu/services/error.rb
shamu-0.0.17 lib/shamu/services/error.rb
shamu-0.0.15 lib/shamu/services/error.rb
shamu-0.0.14 lib/shamu/services/error.rb
shamu-0.0.13 lib/shamu/services/error.rb