Exception: KubeException
- Inherits:
-
StandardError
- Object
- StandardError
- KubeException
- Defined in:
- lib/kubeclient/http_error.rb
Overview
TODO: remove this on next major version bump Deprected http exception
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(error_code, message, response) ⇒ KubeException
constructor
A new instance of KubeException.
- #to_s ⇒ Object
Constructor Details
#initialize(error_code, message, response) ⇒ KubeException
Returns a new instance of KubeException.
6 7 8 9 10 |
# File 'lib/kubeclient/http_error.rb', line 6 def initialize(error_code, , response) @error_code = error_code @message = @response = response end |
Instance Attribute Details
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
4 5 6 |
# File 'lib/kubeclient/http_error.rb', line 4 def error_code @error_code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/kubeclient/http_error.rb', line 4 def @message end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/kubeclient/http_error.rb', line 4 def response @response end |
Instance Method Details
#to_s ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/kubeclient/http_error.rb', line 12 def to_s string = "HTTP status code #{@error_code}, #{@message}" if @response.is_a?(RestClient::Response) && @response.request string << " for #{@response.request.method.upcase} #{@response.request.url}" end string end |