Sha256: 79f3999b8ea3ff06c8cca29169e69edf4d26f539276abe2f0daad7a593831ec4

Contents?: true

Size: 721 Bytes

Versions: 2

Compression:

Stored size: 721 Bytes

Contents

# encoding: utf-8

module GithubCLI

  class GithubCLIError < StandardError
    def self.status_code(code)
      define_method(:status_code) { code }
    end
  end

  # Raised when a configuration file is corrupt or missing.
  class ConfigFileNotFound < GithubCLIError
    status_code 10

    def initialize
      super %{Configuration file corrupt or missing}
    end
  end

  # Raised when GitHub api raised error
  class GitHubError < GithubCLIError
    status_code 11
  end

  class HTTPError < GithubCLIError
    status_code 12
  end

  class UnknownFormatError < GithubCLIError
    status_code 13

    def initialize(format)
      super %{Unrecognized formatting options: #{format} }
    end
  end

end # GithubCLI

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
github_cli-0.3.1 lib/github_cli/errors.rb
github_cli-0.3.0 lib/github_cli/errors.rb