Sha256: 6ac6b15bb236f941dcbd445ef85695bc76f79a693d683cea5d5330a19dbfcea3

Contents?: true

Size: 755 Bytes

Versions: 1

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

1 entries across 1 versions & 1 rubygems

Version Path
shamu-0.0.11 lib/shamu/services/error.rb