Exception: K8s::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/k8s/error.rb

Overview

Top-level class for all errors raised by this gem.

Direct Known Subclasses

API, UndefinedResource

Defined Under Namespace

Classes: API, UndefinedResource

Constant Summary collapse

HTTP_STATUS_ERRORS =

specific API error subtypes for HTTP status codes Hash=> Class<API>

{}

Class Method Summary collapse

Class Method Details

.define_status_error(code, name) ⇒ Object

define a new API error type on the module for the given HTTP status code

Parameters:

  • code (Integer)

    HTTP status code

  • name (Symbol)

    API error class name



41
42
43
# File 'lib/k8s/error.rb', line 41

def self.define_status_error(code, name)
  HTTP_STATUS_ERRORS[code] = self.const_set(name, Class.new(API))
end