Sha256: cabaa62996163c9d2999594fbba7c6711b5136ecd8286222acd2d630b8fb9f22

Contents?: true

Size: 393 Bytes

Versions: 22

Compression:

Stored size: 393 Bytes

Contents

module Clamp
  
  class Error < StandardError

    def initialize(message, command)
      super(message)
      @command = command
    end

    attr_reader :command

  end

  # raise to signal incorrect command usage
  class UsageError < Error; end

  # raise to request usage help
  class HelpWanted < Error

    def initialize(command)
      super("I need help", command)
    end

  end

end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
clamp-0.1.0 lib/clamp/errors.rb
clamp-0.0.9 lib/clamp/errors.rb