docs/ExceptionHunter.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Module: ExceptionHunter
— Documentation by YARD 0.9.26
</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 = "ExceptionHunter";
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">ExceptionHunter</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>Module: ExceptionHunter
</h1>
<div class="box_info">
<dl>
<dt>Extended by:</dt>
<dd><span class='object_link'><a href="ExceptionHunter/Tracking.html" title="ExceptionHunter::Tracking (module)">Tracking</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>lib/exception_hunter.rb<span class="defines">,<br />
lib/exception_hunter/config.rb,<br /> lib/exception_hunter/devise.rb,<br /> lib/exception_hunter/engine.rb,<br /> lib/exception_hunter/version.rb,<br /> lib/exception_hunter/tracking.rb,<br /> lib/exception_hunter/error_reaper.rb,<br /> lib/exception_hunter/data_redacter.rb,<br /> lib/exception_hunter/error_creator.rb,<br /> lib/exception_hunter/notifiers/slack_notifier.rb,<br /> lib/exception_hunter/middleware/request_hunter.rb,<br /> lib/exception_hunter/middleware/request_hunter.rb,<br /> lib/exception_hunter/middleware/sidekiq_hunter.rb,<br /> lib/exception_hunter/user_attributes_collector.rb,<br /> lib/exception_hunter/middleware/delayed_job_hunter.rb,<br /> lib/exception_hunter/notifiers/misconfigured_notifiers.rb,<br /> lib/exception_hunter/notifiers/slack_notifier_serializer.rb</span>
</dd>
</dl>
</div>
<div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
</div><h2>Defined Under Namespace</h2>
<p class="children">
<strong class="modules">Modules:</strong> <span class='object_link'><a href="ExceptionHunter/Devise.html" title="ExceptionHunter::Devise (module)">Devise</a></span>, <span class='object_link'><a href="ExceptionHunter/Middleware.html" title="ExceptionHunter::Middleware (module)">Middleware</a></span>, <span class='object_link'><a href="ExceptionHunter/Notifiers.html" title="ExceptionHunter::Notifiers (module)">Notifiers</a></span>, <span class='object_link'><a href="ExceptionHunter/Tracking.html" title="ExceptionHunter::Tracking (module)">Tracking</a></span>, <span class='object_link'><a href="ExceptionHunter/UserAttributesCollector.html" title="ExceptionHunter::UserAttributesCollector (module)">UserAttributesCollector</a></span>
<strong class="classes">Classes:</strong> <span class='object_link'><a href="ExceptionHunter/Config.html" title="ExceptionHunter::Config (class)">Config</a></span>, <span class='object_link'><a href="ExceptionHunter/DataRedacter.html" title="ExceptionHunter::DataRedacter (class)">DataRedacter</a></span>, <span class='object_link'><a href="ExceptionHunter/ErrorCreator.html" title="ExceptionHunter::ErrorCreator (class)">ErrorCreator</a></span>, <span class='object_link'><a href="ExceptionHunter/ErrorReaper.html" title="ExceptionHunter::ErrorReaper (class)">ErrorReaper</a></span>
</p>
<h2>
Constant Summary
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
</h2>
<dl class="constants">
<dt id="VERSION-constant" class="">VERSION =
<div class="docstring">
<div class="discussion">
</div>
</div>
<div class="tags">
</div>
</dt>
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>1.1.0</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
</dl>
<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="#routes-class_method" title="routes (class method)">.<strong>routes</strong>(router) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Mounts the ExceptionHunter dashboard at /exception_hunter if it's enabled on the current environment.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#setup-class_method" title="setup (class method)">.<strong>setup</strong>(&block) </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Used to setup ExceptionHunter's configuration it receives a block with the <span class='object_link'><a href="ExceptionHunter/Config.html" title="ExceptionHunter::Config (class)">Config</a></span> singleton class.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#track-class_method" title="#track (class method)">.<strong>track</strong>(exception, custom_data: {}, user: nil) </a>
</span>
<span class="note title not_defined_here">
extended
from <span class='object_link'><a href="ExceptionHunter/Tracking.html#track-class_method" title="ExceptionHunter::Tracking#track (method)">Tracking</a></span>
</span>
<span class="summary_desc"><div class='inline'>
<p>Used to manually track errors in cases where raising might not be adequate and but some insight is desired.</p>
</div></span>
</li>
</ul>
<div id="class_method_details" class="method_details_list">
<h2>Class Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="routes-class_method">
.<strong>routes</strong>(router)
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p>
<p>Mounts the ExceptionHunter dashboard at /exception_hunter if it's enabled on the current environment.</p>
</div>
</div>
<div class="tags">
<div class="examples">
<p class="tag_title">Examples:</p>
<pre class="example code"><code><span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_application'>application</span><span class='period'>.</span><span class='id identifier rubyid_routes'>routes</span><span class='period'>.</span><span class='id identifier rubyid_draw'>draw</span> <span class='kw'>do</span>
<span class='const'><span class='object_link'><a href="" title="ExceptionHunter (module)">ExceptionHunter</a></span></span><span class='period'>.</span><span class='id identifier rubyid_routes'>routes</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
<span class='kw'>end</span></code></pre>
</div>
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>router</span>
<span class='type'>(<tt>ActionDispatch::Routing::Mapper</tt>)</span>
—
<div class='inline'>
<p>to mount to</p>
</div>
</li>
</ul>
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
41
42
43
44
45</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/exception_hunter.rb', line 41</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_routes'>routes</span><span class='lparen'>(</span><span class='id identifier rubyid_router'>router</span><span class='rparen'>)</span>
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='const'><span class='object_link'><a href="ExceptionHunter/Config.html" title="ExceptionHunter::Config (class)">Config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_enabled'><span class='object_link'><a href="ExceptionHunter/Config.html#enabled-instance_method" title="ExceptionHunter::Config#enabled (method)">enabled</a></span></span>
<span class='id identifier rubyid_router'>router</span><span class='period'>.</span><span class='id identifier rubyid_mount'>mount</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="" title="ExceptionHunter (module)">ExceptionHunter</a></span></span><span class='op'>::</span><span class='const'>Engine</span><span class='comma'>,</span> <span class='label'>at:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>exception_hunter</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="setup-class_method">
.<strong>setup</strong>(&block)
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p>
<p>Used to setup ExceptionHunter's configuration it receives a block with the <span class='object_link'><a href="ExceptionHunter/Config.html" title="ExceptionHunter::Config (class)">Config</a></span> singleton class.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
26
27
28
29</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/exception_hunter.rb', line 26</span>
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_setup'>setup</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
<span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ExceptionHunter/Config.html" title="ExceptionHunter::Config (class)">Config</a></span></span><span class='rparen'>)</span>
<span class='id identifier rubyid_validate_config!'>validate_config!</span>
<span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="track-class_method">
.<strong>track</strong>(exception, custom_data: {}, user: nil)
<span class="not_defined_here">
Originally defined in module
<span class='object_link'><a href="ExceptionHunter/Tracking.html#track-class_method" title="ExceptionHunter::Tracking#track (method)">Tracking</a></span>
</span>
</h3><div class="docstring">
<div class="discussion">
<p class="note returns_void">This method returns an undefined value.</p>
<p>Used to manually track errors in cases where raising might not be adequate and but some insight is desired.</p>
</div>
</div>
<div class="tags">
<div class="examples">
<p class="tag_title">Examples:</p>
<p class="example_title"><div class='inline'>
<p>Track the else clause on a case</p>
</div></p>
<pre class="example code"><code><span class='kw'>case</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span>
<span class='kw'>when</span> <span class='symbol'>:active</span> <span class='kw'>then</span> <span class='id identifier rubyid_do_something'>do_something</span><span class='lparen'>(</span><span class='rparen'>)</span>
<span class='kw'>when</span> <span class='symbol'>:inactive</span> <span class='kw'>then</span> <span class='id identifier rubyid_do_something_else'>do_something_else</span><span class='lparen'>(</span><span class='rparen'>)</span>
<span class='kw'>else</span>
<span class='const'><span class='object_link'><a href="" title="ExceptionHunter (module)">ExceptionHunter</a></span></span><span class='period'>.</span><span class='id identifier rubyid_track'>track</span><span class='lparen'>(</span><span class='const'>StandardError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>User with unknown status</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='comma'>,</span>
<span class='label'>custom_data:</span> <span class='lbrace'>{</span> <span class='label'>status:</span> <span class='id identifier rubyid_user'>user</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='rbrace'>}</span><span class='comma'>,</span>
<span class='label'>user:</span> <span class='id identifier rubyid_user'>user</span><span class='rparen'>)</span>
<span class='kw'>end</span></code></pre>
</div>
<p class="tag_title">Parameters:</p>
<ul class="param">
<li>
<span class='name'>exception</span>
<span class='type'>(<tt>Exception</tt>)</span>
—
<div class='inline'>
<p>to track.</p>
</div>
</li>
<li>
<span class='name'>custom_data</span>
<span class='type'>(<tt>Hash</tt>)</span>
<em class="default">(defaults to: <tt>{}</tt>)</em>
—
<div class='inline'>
<p>to include and help debug the error. (optional)</p>
</div>
</li>
<li>
<span class='name'>user</span>
<span class='type'>(<tt>User</tt>)</span>
<em class="default">(defaults to: <tt>nil</tt>)</em>
—
<div class='inline'>
<p>in the current session. (optional)</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="footer">
Generated on Fri Jul 30 14:46:20 2021 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.26 (ruby-2.6.5).
</div>
</div>
</body>
</html>