Skip to content

Commit 23f9071

Browse files
authored
Release v1.1.0 (#124)
1 parent 9f2a8cf commit 23f9071

27 files changed

+265
-155
lines changed

CHANGELOG.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# Change log
2-
32
## master (unreleased)
43

54
### New features
65

7-
- [#113](https://github.com/rootstrap/exception_hunter/pull/113) Add configuration to turn on/off async logging using ActionJob. (
8-
[@matteo95g][])
9-
- [#119](https://github.com/rootstrap/exception_hunter/pull/119) Add support for tracking manual exceptions within transactions. ([@lalopsb][])
10-
116
### Bug fixes
127

8+
## 1.1.0 (2021-07-30)
9+
10+
### New features
11+
12+
- [#113](https://github.com/rootstrap/exception_hunter/pull/113) Add configuration to turn on/off async logging using ActionJob. (
13+
[@matteo95g][])
14+
- [#119](https://github.com/rootstrap/exception_hunter/pull/119) Add support for tracking manual exceptions within transactions. ([@lalopsb][])
1315
### Others
1416

1517
- [#114](https://github.com/rootstrap/exception_hunter/pull/114) Fix development vulnerabilities ([@brunvez][])

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ GIT
3030
PATH
3131
remote: .
3232
specs:
33-
exception_hunter (1.0.2)
33+
exception_hunter (1.1.0)
3434
pagy (~> 3)
3535
slack-notifier (~> 2.3)
3636

@@ -160,7 +160,7 @@ GEM
160160
mini_portile2 (~> 2.5.0)
161161
racc (~> 1.4)
162162
orm_adapter (0.5.0)
163-
pagy (3.13.0)
163+
pagy (3.14.0)
164164
parallel (1.20.1)
165165
parser (2.7.2.0)
166166
ast (~> 2.4.1)

docs/ExceptionHunter.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>
77
Module: ExceptionHunter
88

9-
&mdash; Documentation by YARD 0.9.25
9+
&mdash; Documentation by YARD 0.9.26
1010

1111
</title>
1212

@@ -132,7 +132,7 @@ <h2>
132132

133133
</div>
134134
</dt>
135-
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1.0.1</span><span class='tstring_end'>&#39;</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
135+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>1.1.0</span><span class='tstring_end'>&#39;</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
136136

137137
</dl>
138138

@@ -465,9 +465,9 @@ <h3 class="signature " id="track-class_method">
465465
</div>
466466

467467
<div id="footer">
468-
Generated on Fri Dec 18 14:15:02 2020 by
468+
Generated on Fri Jul 30 14:46:20 2021 by
469469
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
470-
0.9.25 (ruby-2.6.5).
470+
0.9.26 (ruby-2.6.5).
471471
</div>
472472

473473
</div>

docs/ExceptionHunter/Config.html

+91-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>
77
Class: ExceptionHunter::Config
88

9-
&mdash; Documentation by YARD 0.9.25
9+
&mdash; Documentation by YARD 0.9.26
1010

1111
</title>
1212

@@ -141,6 +141,33 @@ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collaps
141141
<p>The name of the admin class (generally AdminUser).</p>
142142
</div></span>
143143

144+
</li>
145+
146+
147+
<li class="public ">
148+
<span class="summary_signature">
149+
150+
<a href="#async_logging-instance_method" title="#async_logging (instance method)">#<strong>async_logging</strong> &#x21d2; Boolean </a>
151+
152+
153+
154+
</span>
155+
156+
157+
158+
159+
160+
161+
162+
163+
164+
165+
166+
167+
<span class="summary_desc"><div class='inline'>
168+
<p>Whether ExceptionHunter should log async or not.</p>
169+
</div></span>
170+
144171
</li>
145172

146173

@@ -381,6 +408,63 @@ <h3 class="signature first" id="admin_user_class-instance_method">
381408
</div>
382409

383410

411+
<span id="async_logging=-instance_method"></span>
412+
<div class="method_details ">
413+
<h3 class="signature " id="async_logging-instance_method">
414+
415+
#<strong>async_logging</strong> &#x21d2; <tt>Boolean</tt>
416+
417+
418+
419+
420+
421+
</h3><div class="docstring">
422+
<div class="discussion">
423+
424+
<p>Returns whether ExceptionHunter should log async or not.</p>
425+
426+
427+
</div>
428+
</div>
429+
<div class="tags">
430+
431+
<p class="tag_title">Returns:</p>
432+
<ul class="return">
433+
434+
<li>
435+
436+
437+
<span class='type'>(<tt>Boolean</tt>)</span>
438+
439+
440+
441+
&mdash;
442+
<div class='inline'>
443+
<p>whether ExceptionHunter should log async or not</p>
444+
</div>
445+
446+
</li>
447+
448+
</ul>
449+
450+
</div><table class="source_code">
451+
<tr>
452+
<td>
453+
<pre class="lines">
454+
455+
456+
22</pre>
457+
</td>
458+
<td>
459+
<pre class="code"><span class="info file"># File 'lib/exception_hunter/config.rb', line 22</span>
460+
461+
<span class='id identifier rubyid_cattr_accessor'>cattr_accessor</span> <span class='symbol'>:async_logging</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='kw'>false</span></pre>
462+
</td>
463+
</tr>
464+
</table>
465+
</div>
466+
467+
384468
<span id="current_user_method=-instance_method"></span>
385469
<div class="method_details ">
386470
<h3 class="signature " id="current_user_method-instance_method">
@@ -545,12 +629,12 @@ <h3 class="signature first" id="auth_enabled?-class_method">
545629
<pre class="lines">
546630

547631

548-
25
549-
26
550-
27</pre>
632+
28
633+
29
634+
30</pre>
551635
</td>
552636
<td>
553-
<pre class="code"><span class="info file"># File 'lib/exception_hunter/config.rb', line 25</span>
637+
<pre class="code"><span class="info file"># File 'lib/exception_hunter/config.rb', line 28</span>
554638

555639
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_auth_enabled?'>auth_enabled?</span>
556640
<span class='id identifier rubyid_admin_user_class'>admin_user_class</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_admin_user_class'>admin_user_class</span><span class='period'>.</span><span class='id identifier rubyid_try'>try</span><span class='lparen'>(</span><span class='symbol'>:underscore</span><span class='rparen'>)</span>
@@ -736,9 +820,9 @@ <h3 class="signature " id="user_attributes-instance_method">
736820
</div>
737821

738822
<div id="footer">
739-
Generated on Fri Dec 18 14:15:02 2020 by
823+
Generated on Fri Jul 30 14:46:20 2021 by
740824
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
741-
0.9.25 (ruby-2.6.5).
825+
0.9.26 (ruby-2.6.5).
742826
</div>
743827

744828
</div>

docs/ExceptionHunter/DataRedacter.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>
77
Class: ExceptionHunter::DataRedacter
88

9-
&mdash; Documentation by YARD 0.9.25
9+
&mdash; Documentation by YARD 0.9.26
1010

1111
</title>
1212

@@ -423,9 +423,9 @@ <h3 class="signature first" id="redact-instance_method">
423423
</div>
424424

425425
<div id="footer">
426-
Generated on Fri Dec 18 14:15:02 2020 by
426+
Generated on Fri Jul 30 14:46:20 2021 by
427427
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
428-
0.9.25 (ruby-2.6.5).
428+
0.9.26 (ruby-2.6.5).
429429
</div>
430430

431431
</div>

docs/ExceptionHunter/Devise.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>
77
Module: ExceptionHunter::Devise
88

9-
&mdash; Documentation by YARD 0.9.25
9+
&mdash; Documentation by YARD 0.9.26
1010

1111
</title>
1212

@@ -114,9 +114,9 @@
114114
</div>
115115

116116
<div id="footer">
117-
Generated on Fri Dec 18 14:15:02 2020 by
117+
Generated on Fri Jul 30 14:46:20 2021 by
118118
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119-
0.9.25 (ruby-2.6.5).
119+
0.9.26 (ruby-2.6.5).
120120
</div>
121121

122122
</div>

docs/ExceptionHunter/Devise/SessionsController.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>
77
Class: ExceptionHunter::Devise::SessionsController
88

9-
&mdash; Documentation by YARD 0.9.25
9+
&mdash; Documentation by YARD 0.9.26
1010

1111
</title>
1212

@@ -264,9 +264,9 @@ <h3 class="signature " id="after_sign_out_path_for-instance_method">
264264
</div>
265265

266266
<div id="footer">
267-
Generated on Fri Dec 18 14:15:02 2020 by
267+
Generated on Fri Jul 30 14:46:20 2021 by
268268
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
269-
0.9.25 (ruby-2.6.5).
269+
0.9.26 (ruby-2.6.5).
270270
</div>
271271

272272
</div>

docs/ExceptionHunter/ErrorCreator.html

+27-27
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>
77
Class: ExceptionHunter::ErrorCreator
88

9-
&mdash; Documentation by YARD 0.9.25
9+
&mdash; Documentation by YARD 0.9.26
1010

1111
</title>
1212

@@ -161,6 +161,20 @@ <h2>
161161
</dt>
162162
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Manual</span><span class='tstring_end'>&#39;</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
163163

164+
<dt id="NOTIFICATION_DELAY-constant" class="">NOTIFICATION_DELAY =
165+
<div class="docstring">
166+
<div class="discussion">
167+
168+
169+
</div>
170+
</div>
171+
<div class="tags">
172+
173+
174+
</div>
175+
</dt>
176+
<dd><pre class="code"><span class='int'>1</span><span class='period'>.</span><span class='id identifier rubyid_minute'>minute</span></pre></dd>
177+
164178
</dl>
165179

166180

@@ -181,7 +195,7 @@ <h2>
181195
<li class="public ">
182196
<span class="summary_signature">
183197

184-
<a href="#call-class_method" title="call (class method)">.<strong>call</strong>(tag: nil, **error_attrs) &#x21d2; ExceptionHunter::Error, false </a>
198+
<a href="#call-class_method" title="call (class method)">.<strong>call</strong>(async_logging: Config.async_logging, tag: nil, **error_attrs) &#x21d2; ExceptionHunter::Error, false </a>
185199

186200

187201

@@ -214,7 +228,7 @@ <h2>Class Method Details</h2>
214228
<div class="method_details first">
215229
<h3 class="signature first" id="call-class_method">
216230

217-
.<strong>call</strong>(tag: nil, **error_attrs) &#x21d2; <tt>ExceptionHunter::Error</tt>, <tt>false</tt>
231+
.<strong>call</strong>(async_logging: Config.async_logging, tag: nil, **error_attrs) &#x21d2; <tt>ExceptionHunter::Error</tt>, <tt>false</tt>
218232

219233

220234

@@ -277,7 +291,6 @@ <h3 class="signature first" id="call-class_method">
277291
<pre class="lines">
278292

279293

280-
14
281294
15
282295
16
283296
17
@@ -289,32 +302,19 @@ <h3 class="signature first" id="call-class_method">
289302
23
290303
24
291304
25
292-
26
293-
27
294-
28
295-
29
296-
30
297-
31
298-
32</pre>
305+
26</pre>
299306
</td>
300307
<td>
301-
<pre class="code"><span class="info file"># File 'lib/exception_hunter/error_creator.rb', line 14</span>
308+
<pre class="code"><span class="info file"># File 'lib/exception_hunter/error_creator.rb', line 15</span>
302309

303-
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='label'>tag:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_error_attrs'>error_attrs</span><span class='rparen'>)</span>
310+
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='label'>async_logging:</span> <span class='const'><span class='object_link'><a href="Config.html" title="ExceptionHunter::Config (class)">Config</a></span></span><span class='period'>.</span><span class='id identifier rubyid_async_logging'><span class='object_link'><a href="Config.html#async_logging-instance_method" title="ExceptionHunter::Config#async_logging (method)">async_logging</a></span></span><span class='comma'>,</span> <span class='label'>tag:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_error_attrs'>error_attrs</span><span class='rparen'>)</span>
304311
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_should_create?'>should_create?</span>
305312

306-
<span class='const'>ActiveRecord</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id identifier rubyid_transaction'>transaction</span> <span class='kw'>do</span>
307-
<span class='id identifier rubyid_error_attrs'>error_attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_extract_user_data'>extract_user_data</span><span class='lparen'>(</span><span class='id identifier rubyid_error_attrs'>error_attrs</span><span class='rparen'>)</span>
308-
<span class='id identifier rubyid_error_attrs'>error_attrs</span> <span class='op'>=</span> <span class='id identifier rubyid_hide_sensitive_values'>hide_sensitive_values</span><span class='lparen'>(</span><span class='id identifier rubyid_error_attrs'>error_attrs</span><span class='rparen'>)</span>
309-
<span class='id identifier rubyid_error'>error</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="../ExceptionHunter.html" title="ExceptionHunter (module)">ExceptionHunter</a></span></span><span class='op'>::</span><span class='const'>Error</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_error_attrs'>error_attrs</span><span class='rparen'>)</span>
310-
<span class='id identifier rubyid_error_group'>error_group</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="../ExceptionHunter.html" title="ExceptionHunter (module)">ExceptionHunter</a></span></span><span class='op'>::</span><span class='const'>ErrorGroup</span><span class='period'>.</span><span class='id identifier rubyid_find_matching_group'>find_matching_group</span><span class='lparen'>(</span><span class='id identifier rubyid_error'>error</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="../ExceptionHunter.html" title="ExceptionHunter (module)">ExceptionHunter</a></span></span><span class='op'>::</span><span class='const'>ErrorGroup</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
311-
<span class='id identifier rubyid_update_error_group'>update_error_group</span><span class='lparen'>(</span><span class='id identifier rubyid_error_group'>error_group</span><span class='comma'>,</span> <span class='id identifier rubyid_error'>error</span><span class='comma'>,</span> <span class='id identifier rubyid_tag'>tag</span><span class='rparen'>)</span>
312-
<span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_error_group'>error_group</span> <span class='op'>=</span> <span class='id identifier rubyid_error_group'>error_group</span>
313-
<span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_save!'>save!</span>
314-
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_error_group'>error_group</span><span class='period'>.</span><span class='id identifier rubyid_ignored?'>ignored?</span>
315-
316-
<span class='id identifier rubyid_notify'>notify</span><span class='lparen'>(</span><span class='id identifier rubyid_error'>error</span><span class='rparen'>)</span>
317-
<span class='id identifier rubyid_error'>error</span>
313+
<span class='kw'>if</span> <span class='id identifier rubyid_async_logging'>async_logging</span>
314+
<span class='comment'># Time is sent in unix format and then converted to Time to avoid ActiveJob::SerializationError
315+
</span> <span class='op'>::</span><span class='const'><span class='object_link'><a href="../ExceptionHunter.html" title="ExceptionHunter (module)">ExceptionHunter</a></span></span><span class='op'>::</span><span class='const'>AsyncLoggingJob</span><span class='period'>.</span><span class='id identifier rubyid_perform_later'>perform_later</span><span class='lparen'>(</span><span class='id identifier rubyid_tag'>tag</span><span class='comma'>,</span> <span class='id identifier rubyid_error_attrs'>error_attrs</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>occurred_at:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span><span class='rparen'>)</span>
316+
<span class='kw'>else</span>
317+
<span class='id identifier rubyid_create_error'>create_error</span><span class='lparen'>(</span><span class='id identifier rubyid_tag'>tag</span><span class='comma'>,</span> <span class='id identifier rubyid_error_attrs'>error_attrs</span><span class='rparen'>)</span>
318318
<span class='kw'>end</span>
319319
<span class='kw'>rescue</span> <span class='const'>ActiveRecord</span><span class='op'>::</span><span class='const'>RecordInvalid</span>
320320
<span class='kw'>false</span>
@@ -329,9 +329,9 @@ <h3 class="signature first" id="call-class_method">
329329
</div>
330330

331331
<div id="footer">
332-
Generated on Fri Dec 18 14:15:02 2020 by
332+
Generated on Fri Jul 30 14:46:20 2021 by
333333
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
334-
0.9.25 (ruby-2.6.5).
334+
0.9.26 (ruby-2.6.5).
335335
</div>
336336

337337
</div>

docs/ExceptionHunter/ErrorReaper.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>
77
Class: ExceptionHunter::ErrorReaper
88

9-
&mdash; Documentation by YARD 0.9.25
9+
&mdash; Documentation by YARD 0.9.26
1010

1111
</title>
1212

@@ -240,9 +240,9 @@ <h3 class="signature first" id="purge-class_method">
240240
</div>
241241

242242
<div id="footer">
243-
Generated on Fri Dec 18 14:15:02 2020 by
243+
Generated on Fri Jul 30 14:46:20 2021 by
244244
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
245-
0.9.25 (ruby-2.6.5).
245+
0.9.26 (ruby-2.6.5).
246246
</div>
247247

248248
</div>

0 commit comments

Comments
 (0)