Files
metasploit-gs/api/Msf/RPC/JSON/RpcError.html
T

602 lines
15 KiB
HTML
Raw Normal View History

2026-05-08 17:08:43 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Exception: Msf::RPC::JSON::RpcError
&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::RpcError";
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 (R)</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">RpcError</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::RpcError
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">StandardError</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">StandardError</li>
<li class="next">Msf::RPC::JSON::RpcError</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>Overview</h2><div class="docstring">
<div class="discussion">
<p>Base class for all Msf::RPC::JSON exceptions.</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="InternalError.html" title="Msf::RPC::JSON::InternalError (class)">InternalError</a></span>, <span class='object_link'><a href="InvalidParams.html" title="Msf::RPC::JSON::InvalidParams (class)">InvalidParams</a></span>, <span class='object_link'><a href="InvalidRequest.html" title="Msf::RPC::JSON::InvalidRequest (class)">InvalidRequest</a></span>, <span class='object_link'><a href="MethodNotFound.html" title="Msf::RPC::JSON::MethodNotFound (class)">MethodNotFound</a></span>, <span class='object_link'><a href="ParseError.html" title="Msf::RPC::JSON::ParseError (class)">ParseError</a></span>, <span class='object_link'><a href="ServerError.html" title="Msf::RPC::JSON::ServerError (class)">ServerError</a></span></p>
</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>Code Message Meaning -32700 Parse error Invalid JSON was received by the server.</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="#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>
<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>(code, message, data: nil) &#x21d2; RpcError </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>Instantiate an RpcError object.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#to_h-instance_method" title="#to_h (instance method)">#<strong>to_h</strong> &#x21d2; Object </a>
</span>
<span class="summary_desc"><div class='inline'></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>(code, message, data: nil) &#x21d2; <tt><span class='object_link'><a href="" title="Msf::RPC::JSON::RpcError (class)">RpcError</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Instantiate an RpcError object.</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<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>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
51
52
53
54
55
56</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 51</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>data:</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='rparen'>)</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>Code Message Meaning -32700 Parse error Invalid JSON was received by the server. An error</p>
<pre class="code ruby"><code class="ruby">occurred on the server while parsing the JSON text.
</code></pre>
<p>-32600 Invalid Request The JSON sent is not a valid Request object. -32601 Method not found The method does not exist / is not available. -32602 Invalid params Invalid method parameter(s). -32603 Internal error Internal JSON-RPC error. -32000 to -32099 Server error Reserved for implementation-defined server-errors.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
38
39
40</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 38</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">
40
41
42</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 40</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="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">
39
40
41</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 39</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="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="to_h-instance_method">
#<strong>to_h</strong> &#x21d2; <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/msf/core/rpc/json/error.rb', line 58</span>
<span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span>
<span class='label'>code:</span> <span class='ivar'>@code</span><span class='comma'>,</span>
<span class='label'>message:</span> <span class='ivar'>@message</span>
<span class='rbrace'>}</span>
<span class='comment'># process data member
</span> <span class='kw'>unless</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='kw'>if</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Numeric</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@data</span>
<span class='kw'>elsif</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:to_h</span><span class='rparen'>)</span>
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span>
<span class='kw'>else</span>
<span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:data</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='kw'>end</span>
<span class='kw'>end</span>
<span class='id identifier rubyid_hash'>hash</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>