Exception: K8s::Error::API
- Inherits:
-
K8s::Error
- Object
- StandardError
- K8s::Error
- K8s::Error::API
- Extended by:
- Forwardable
- Defined in:
- lib/k8s/error.rb
Overview
Kube API error, related to a HTTP response with a non-2xx code
Constant Summary
Constants inherited from K8s::Error
BadRequest, Configuration, Conflict, Forbidden, HTTP_STATUS_ERRORS, InternalError, Invalid, MethodNotAllowed, NotFound, ServerTimeout, ServiceUnavailable, Timeout, Unauthorized, UndefinedResource
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(method, path, code, reason, status = nil) ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize(method, path, code, reason, status = nil) ⇒ API
Returns a new instance of API.
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/k8s/error.rb', line 19 def initialize(method, path, code, reason, status = nil) @method = method @path = path @code = code @reason = reason @status = status if status super("#{@method} #{@path} => HTTP #{@code} #{@reason}: #{@status.}") else super("#{@method} #{@path} => HTTP #{@code} #{@reason}") end end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
12 13 14 |
# File 'lib/k8s/error.rb', line 12 def code @code end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
12 13 14 |
# File 'lib/k8s/error.rb', line 12 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/k8s/error.rb', line 12 def path @path end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
12 13 14 |
# File 'lib/k8s/error.rb', line 12 def reason @reason end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/k8s/error.rb', line 12 def status @status end |