Exception: Msf::Exploit::Remote::HTTP::Kubernetes::Error::ServerError

Inherits:
ApiError
  • Object
show all
Defined in:
lib/msf/core/exploit/remote/http/kubernetes/error.rb

Instance Attribute Summary

Attributes inherited from ApiError

#res

Instance Method Summary collapse

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: 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