Exception: Msf::Exploit::Remote::HTTP::Kubernetes::Error::ServerError
- Inherits:
-
ApiError
- Object
- StandardError
- ApiError
- Msf::Exploit::Remote::HTTP::Kubernetes::Error::ServerError
- Defined in:
- lib/msf/core/exploit/remote/http/kubernetes/error.rb
Instance Attribute Summary
Attributes inherited from ApiError
Instance Method Summary collapse
-
#initialize(message: nil, res: nil) ⇒ ServerError
constructor
A new instance of ServerError.
- #server_error_for(res) ⇒ Object protected
Constructor Details
#initialize(message: nil, res: nil) ⇒ ServerError
Returns a new instance of ServerError.
46 47 48 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/error.rb', line 46 def initialize(message: nil, res: nil) super(message: || server_error_for(res), res: res) end |
Instance Method Details
#server_error_for(res) ⇒ Object (protected)
52 53 54 55 56 57 |
# File 'lib/msf/core/exploit/remote/http/kubernetes/error.rb', line 52 def server_error_for(res) json = res.get_json_document return "Kubernetes ServerError #{res.code}" if json.nil? "Kubernetes ServerError #{res.code} - #{json.fetch('message', 'Failure')} " end |