Sha256: 46958ea1c547dfe7edd3664f3b832049e31863cd243e714ecf4de2af9e37c17e

Contents?: true

Size: 780 Bytes

Versions: 2

Compression:

Stored size: 780 Bytes

Contents

# encoding: utf-8

module GithubCLI

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

  class ApiError < GithubCLIError
    status_code 5
  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.4.1 lib/github_cli/errors.rb
github_cli-0.4.0 lib/github_cli/errors.rb