docs/Prismic/Error.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Exception: Prismic::Error
— Documentation by YARD 0.9.8
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
pathId = "Prismic::Error";
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> »
<span class='title'><span class='object_link'><a href="../Prismic.html" title="Prismic (module)">Prismic</a></span></span>
»
<span class="title">Error</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: Prismic::Error
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName">Exception</span>
<ul class="fullTree">
<li>Object</li>
<li class="next">Exception</li>
<li class="next">Prismic::Error</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/prismic.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>These exception can contains an error cause and is able to show them</p>
</div>
</div>
<div class="tags">
</div><div id="subclasses">
<h2>Direct Known Subclasses</h2>
<p class="children"><span class='object_link'><a href="API/BadPrismicResponseError.html" title="Prismic::API::BadPrismicResponseError (class)">API::BadPrismicResponseError</a></span>, <span class='object_link'><a href="API/PrismicWSAuthError.html" title="Prismic::API::PrismicWSAuthError (class)">API::PrismicWSAuthError</a></span>, <span class='object_link'><a href="API/PrismicWSConnectionError.html" title="Prismic::API::PrismicWSConnectionError (class)">API::PrismicWSConnectionError</a></span>, <span class='object_link'><a href="Fragments/Image/ViewDoesNotExistException.html" title="Prismic::Fragments::Image::ViewDoesNotExistException (class)">Fragments::Image::ViewDoesNotExistException</a></span>, <span class='object_link'><a href="SearchForm/AuthenticationException.html" title="Prismic::SearchForm::AuthenticationException (class)">SearchForm::AuthenticationException</a></span>, <span class='object_link'><a href="SearchForm/AuthorizationException.html" title="Prismic::SearchForm::AuthorizationException (class)">SearchForm::AuthorizationException</a></span>, <span class='object_link'><a href="SearchForm/FormSearchException.html" title="Prismic::SearchForm::FormSearchException (class)">SearchForm::FormSearchException</a></span>, <span class='object_link'><a href="SearchForm/NoRefSetException.html" title="Prismic::SearchForm::NoRefSetException (class)">SearchForm::NoRefSetException</a></span>, <span class='object_link'><a href="SearchForm/RefNotFoundException.html" title="Prismic::SearchForm::RefNotFoundException (class)">SearchForm::RefNotFoundException</a></span>, <span class='object_link'><a href="SearchForm/UnsupportedFormKind.html" title="Prismic::SearchForm::UnsupportedFormKind (class)">SearchForm::UnsupportedFormKind</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="#cause-instance_method" title="#cause (instance method)">#<strong>cause</strong> ⇒ Object </a>
</span>
<span class="note title readonly">readonly</span>
<span class="summary_desc"><div class='inline'><p>Returns the value of attribute cause.</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="#full_trace-instance_method" title="#full_trace (instance method)">#<strong>full_trace</strong>(e = self) ⇒ String </a>
</span>
<span class="summary_desc"><div class='inline'><p>Return the full trace of the error (including nested errors).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(msg = nil, cause = nil) ⇒ Error </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'><p>A new instance of Error.</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>(msg = nil, cause = nil) ⇒ <tt><span class='object_link'><a href="" title="Prismic::Error (class)">Error</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Returns a new instance of Error</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
19
20
21
22</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/prismic.rb', line 19</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_msg'>msg</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_cause'>cause</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
<span class='id identifier rubyid_msg'>msg</span> <span class='op'>?</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_msg'>msg</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_msg'>msg</span>
<span class='ivar'>@cause</span> <span class='op'>=</span> <span class='id identifier rubyid_cause'>cause</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="cause-instance_method">
#<strong>cause</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
</h3><div class="docstring">
<div class="discussion">
<p>Returns the value of attribute cause</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
18
19
20</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/prismic.rb', line 18</span>
<span class='kw'>def</span> <span class='id identifier rubyid_cause'>cause</span>
<span class='ivar'>@cause</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="full_trace-instance_method">
#<strong>full_trace</strong>(e = self) ⇒ <tt>String</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Return the full trace of the error (including nested errors)</p>
</div>
</div>
<div class="tags">
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>e</span>
<span class='type'>(<tt>Exception</tt>)</span>
<em class="default">(defaults to: <tt>self</tt>)</em>
—
<div class='inline'><p>Parent error (for internal use)</p>
</div>
</li>
</ul>
<p class="tag_title">Returns:</p>
<ul class="return">
<li>
<span class='type'>(<tt>String</tt>)</span>
—
<div class='inline'><p>The trace</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
28
29
30
31
32
33
34
35
36</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/prismic.rb', line 28</span>
<span class='kw'>def</span> <span class='id identifier rubyid_full_trace'>full_trace</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='op'>=</span><span class='kw'>self</span><span class='rparen'>)</span>
<span class='id identifier rubyid_first'>first</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_backtrace'>backtrace</span> <span class='op'>=</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_backtrace'>backtrace</span>
<span class='id identifier rubyid_msg'>msg</span> <span class='op'>=</span> <span class='id identifier rubyid_e'>e</span> <span class='op'>==</span> <span class='kw'>self</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Caused by </span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_msg'>msg</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_first'>first</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_content'> (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>"</span></span>
<span class='id identifier rubyid_stack'>stack</span> <span class='op'>=</span> <span class='id identifier rubyid_backtrace'>backtrace</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_s'>s</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\tfrom </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_s'>s</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_cause'>cause</span> <span class='op'>=</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:cause</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_cause'>cause</span> <span class='op'>:</span> <span class='kw'>nil</span>
<span class='id identifier rubyid_cause_stack'>cause_stack</span> <span class='op'>=</span> <span class='id identifier rubyid_cause'>cause</span> <span class='op'>?</span> <span class='id identifier rubyid_full_trace'>full_trace</span><span class='lparen'>(</span><span class='id identifier rubyid_cause'>cause</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='kw'>nil</span>
<span class='lbracket'>[</span><span class='id identifier rubyid_msg'>msg</span><span class='comma'>,</span> <span class='id identifier rubyid_stack'>stack</span><span class='comma'>,</span> <span class='id identifier rubyid_cause_stack'>cause_stack</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Jan 16 16:05:08 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.8 (ruby-2.3.1).
</div>
</div>
</body>
</html>