Files
metasploit-gs/api/Msf/RPC/JSON/ErrorResponse.html
T
jenkins-metasploit c3f5bd3de2 Reboot gh-pages
2026-05-08 17:08:43 +00:00

787 lines
20 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Exception: Msf::RPC::JSON::ErrorResponse
&mdash; Documentation by YARD 0.9.37
</title>
<link rel="stylesheet" href="../../../css/style.css" type="text/css" />
<link rel="stylesheet" href="../../../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "Msf::RPC::JSON::ErrorResponse";
relpath = '../../../';
</script>
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../../../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../../../_index.html">Index (E)</a> &raquo;
<span class='title'><span class='object_link'><a href="../../../Msf.html" title="Msf (module)">Msf</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../RPC.html" title="Msf::RPC (module)">RPC</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../JSON.html" title="Msf::RPC::JSON (module)">JSON</a></span></span>
&raquo;
<span class="title">ErrorResponse</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../../../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Exception: Msf::RPC::JSON::ErrorResponse
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="ClientError.html" title="Msf::RPC::JSON::ClientError (class)">ClientError</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next">StandardError</li>
<li class="next"><span class='object_link'><a href="ClientError.html" title="Msf::RPC::JSON::ClientError (class)">ClientError</a></span></li>
<li class="next">Msf::RPC::JSON::ErrorResponse</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/msf/core/rpc/json/error.rb</dd>
</dl>
</div>
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#code-instance_method" title="#code (instance method)">#<strong>code</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute code.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#data-instance_method" title="#data (instance method)">#<strong>data</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute data.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#id-instance_method" title="#id (instance method)">#<strong>id</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute id.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#message-instance_method" title="#message (instance method)">#<strong>message</strong> &#x21d2; Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'>
<p>Returns the value of attribute message.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="ClientError.html" title="Msf::RPC::JSON::ClientError (class)">ClientError</a></span></h3>
<p class="inherited"><span class='object_link'><a href="ClientError.html#response-instance_method" title="Msf::RPC::JSON::ClientError#response (method)">#response</a></span></p>
<h2>
Class Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#parse-class_method" title="parse (class method)">.<strong>parse</strong>(response, symbolize_names: true) &#x21d2; ErrorResponse </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Parse response and return a new ErrorResponse instance.</p>
</div></span>
</li>
</ul>
<h2>
Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(id:, code:, message:, data: nil, response: nil) &#x21d2; ErrorResponse </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>Instantiate an ErrorResponse object.</p>
</div></span>
</li>
</ul>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(id:, code:, message:, data: nil, response: nil) &#x21d2; <tt><span class='object_link'><a href="" title="Msf::RPC::JSON::ErrorResponse (class)">ErrorResponse</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Instantiate an ErrorResponse object.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>id</span>
<span class='type'>(<tt>Integer</tt>, <tt>String</tt>, <tt>NilClass</tt>)</span>
&mdash;
<div class='inline'>
<p>It MUST be the same as the value of the id member in the Request Object. If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.</p>
</div>
</li>
<li>
<span class='name'>code</span>
<span class='type'>(<tt>Integer</tt>)</span>
&mdash;
<div class='inline'>
<p>A Number that indicates the error type that occurred.</p>
</div>
</li>
<li>
<span class='name'>message</span>
<span class='type'>(<tt>String</tt>)</span>
&mdash;
<div class='inline'>
<p>A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.</p>
</div>
</li>
<li>
<span class='name'>data</span>
<span class='type'>(<tt>Object</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
&mdash;
<div class='inline'>
<p>A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). The default value is nil.</p>
</div>
</li>
<li>
<span class='name'>response</span>
<span class='type'>(<tt>Hash</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
&mdash;
<div class='inline'>
<p>A response hash. The default value is nil.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
218
219
220
221
222
223
224</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 218</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>id:</span><span class='comma'>,</span> <span class='label'>code:</span><span class='comma'>,</span> <span class='label'>message:</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>response:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
<span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>response:</span> <span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_id'>id</span>
<span class='ivar'>@code</span> <span class='op'>=</span> <span class='id identifier rubyid_code'>code</span>
<span class='ivar'>@message</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span>
<span class='ivar'>@data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_attr_details" class="attr_details">
<h2>Instance Attribute Details</h2>
<span id=""></span>
<div class="method_details first">
<h3 class="signature first" id="code-instance_method">
#<strong>code</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute code.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
173
174
175</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 173</span>
<span class='kw'>def</span> <span class='id identifier rubyid_code'>code</span>
<span class='ivar'>@code</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="data-instance_method">
#<strong>data</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute data.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
175
176
177</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 175</span>
<span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span>
<span class='ivar'>@data</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="id-instance_method">
#<strong>id</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute id.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
172
173
174</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 172</span>
<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
<span class='ivar'>@id</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<span id=""></span>
<div class="method_details ">
<h3 class="signature " id="message-instance_method">
#<strong>message</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute message.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
174
175
176</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 174</span>
<span class='kw'>def</span> <span class='id identifier rubyid_message'>message</span>
<span class='ivar'>@message</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="parse-class_method">
.<strong>parse</strong>(response, symbolize_names: true) &#x21d2; <tt><span class='object_link'><a href="" title="Msf::RPC::JSON::ErrorResponse (class)">ErrorResponse</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Parse response and return a new ErrorResponse instance.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>response</span>
<span class='type'>(<tt>Hash</tt>)</span>
&mdash;
<div class='inline'>
<p>A response hash.</p>
</div>
</li>
<li>
<span class='name'>symbolize_names</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>true</tt>)</em>
&mdash;
<div class='inline'>
<p>If true, symbols are used for the names (keys) when processing JSON objects; otherwise, strings are used. Default: true</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt><span class='object_link'><a href="" title="Msf::RPC::JSON::ErrorResponse (class)">ErrorResponse</a></span></tt>)</span>
&mdash;
<div class='inline'>
<p>ErrorResponse object that represents the response hash.</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 182</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse'>parse</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='comma'>,</span> <span class='label'>symbolize_names:</span> <span class='kw'>true</span><span class='rparen'>)</span>
<span class='id identifier rubyid_id_key'>id_key</span> <span class='op'>=</span> <span class='id identifier rubyid_symbolize_names'>symbolize_names</span> <span class='op'>?</span> <span class='symbol'>:id</span> <span class='op'>:</span> <span class='symbol'>:id</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='id identifier rubyid_error_key'>error_key</span> <span class='op'>=</span> <span class='id identifier rubyid_symbolize_names'>symbolize_names</span> <span class='op'>?</span> <span class='symbol'>:error</span> <span class='op'>:</span> <span class='symbol'>:error</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='id identifier rubyid_code_key'>code_key</span> <span class='op'>=</span> <span class='id identifier rubyid_symbolize_names'>symbolize_names</span> <span class='op'>?</span> <span class='symbol'>:code</span> <span class='op'>:</span> <span class='symbol'>:code</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='id identifier rubyid_message_key'>message_key</span> <span class='op'>=</span> <span class='id identifier rubyid_symbolize_names'>symbolize_names</span> <span class='op'>?</span> <span class='symbol'>:message</span> <span class='op'>:</span> <span class='symbol'>:message</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='id identifier rubyid_data_key'>data_key</span> <span class='op'>=</span> <span class='id identifier rubyid_symbolize_names'>symbolize_names</span> <span class='op'>?</span> <span class='symbol'>:data</span> <span class='op'>:</span> <span class='symbol'>:data</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='id identifier rubyid_id'>id</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='id identifier rubyid_id_key'>id_key</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_error'>error</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='lbracket'>[</span><span class='id identifier rubyid_error_key'>error_key</span><span class='rbracket'>]</span>
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='id identifier rubyid_code'>code</span> <span class='op'>=</span> <span class='id identifier rubyid_error'>error</span><span class='lbracket'>[</span><span class='id identifier rubyid_code_key'>code_key</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='id identifier rubyid_error'>error</span><span class='lbracket'>[</span><span class='id identifier rubyid_message_key'>message_key</span><span class='rbracket'>]</span>
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_error'>error</span><span class='lbracket'>[</span><span class='id identifier rubyid_data_key'>data_key</span><span class='rbracket'>]</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_code'>code</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='kw'>nil</span>
<span class='kw'>end</span>
<span class='const'><span class='object_link'><a href="" title="Msf::RPC::JSON::ErrorResponse (class)">ErrorResponse</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Msf::RPC::JSON::ErrorResponse#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>id:</span> <span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='label'>code:</span> <span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='label'>message:</span> <span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>data:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span> <span class='label'>response:</span> <span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Fri May 8 17:03:23 2026 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.37 (ruby-3.1.5).
</div>
</div>
</body>
</html>