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
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.
Methods inherited from K8s::Error
Constructor Details
#initialize(method, path, code, reason, status = nil) ⇒ API
Returns a new instance of API.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/k8s/error.rb', line 18 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.message}") else super("#{@method} #{@path} => HTTP #{@code} #{@reason}") end end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
11 12 13 |
# File 'lib/k8s/error.rb', line 11 def code @code end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
11 12 13 |
# File 'lib/k8s/error.rb', line 11 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
11 12 13 |
# File 'lib/k8s/error.rb', line 11 def path @path end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
11 12 13 |
# File 'lib/k8s/error.rb', line 11 def reason @reason end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
11 12 13 |
# File 'lib/k8s/error.rb', line 11 def status @status end |