Sha256: 5e88c407890b29b0795e4a47f5a6d0a2b96195e766ca9e5b0b7008a8f03b4866

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

module Pione
  module Command
    class CommandException < StandardError; end

    # SpawnError is raised when the command failed to run.
    class SpawnError < CommandException
      def initialize(caller, callee, argv, cause)
        @caller = caller
        @callee = callee
        @argv = argv
        @cause = cause
      end

      def message
        args = {caller: @caller, callee: @callee, argv: @argv, cause: @cause}
        '"%{caller}" has failed to spawn "%{callee}" %{argv}: %{cause}' % args
      end
    end

    # SpawnerRetry is raised when we need to try spawn check.
    class SpawnerRetry < CommandException; end

    # HideableOptionError is same as OptionError, but it is better for users
    # that this error is ignored in some cases.
    class HideableOptionError < Rootage::OptionError; end

    class ActionNotFound < CommandException
      def initialize(mod, name)
        @mod = mod
        @name = name
      end

      def message
        "Command action \"%s\" not found in %s." % [@name, @mod]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pione-0.4.2 lib/pione/command/command-exception.rb
pione-0.4.1 lib/pione/command/command-exception.rb
pione-0.4.0 lib/pione/command/command-exception.rb