Skip to content

Commit

Permalink
deploy: ce0d98c
Browse files Browse the repository at this point in the history
  • Loading branch information
dusktreader committed Sep 1, 2023
1 parent 905ed17 commit 6203b6d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 5 deletions.
25 changes: 24 additions & 1 deletion features/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,13 @@
handle_exc_class
</a>

</li>

<li class="md-nav__item">
<a href="#ignore_exc_class" class="md-nav__link">
ignore_exc_class
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -607,6 +614,13 @@
handle_exc_class
</a>

</li>

<li class="md-nav__item">
<a href="#ignore_exc_class" class="md-nav__link">
ignore_exc_class
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -907,7 +921,7 @@ <h4 id="exc_builder_1">exc_builder</h4>
<p>Functions the same as <code>require_condition</code>.</p>
<h4 id="handle_exc_class">handle_exc_class</h4>
<p>This option describes the type of exception that will be handled by this context
manager. Any instance of the option's exception (or any of it's derived exception
manager. Any instance of the option's exception (or any of its derived exception
classes) will be caught. This is very useful if you only want to handle a certain
category of exceptions and let the others rise up un-altered:</p>
<div class="codehilite"><pre><span></span><code><span class="k">with</span> <span class="n">handle_errors</span><span class="p">(</span><span class="s2">&quot;Something went wrong&quot;</span><span class="p">,</span> <span class="n">handle_exc_class</span><span class="o">=</span><span class="n">MyProjectError</span><span class="p">):</span>
Expand All @@ -918,6 +932,15 @@ <h4 id="handle_exc_class">handle_exc_class</h4>
<code>handle_exc_class</code> option <em>will not be handled at all</em>. It is worth noting that the
<code>do_except</code> task will <em>not</em> be executed if another exception type occurs. However,
the <code>do_else</code> and <code>do_finally</code> tasks will be executed normally.</p>
<h4 id="ignore_exc_class">ignore_exc_class</h4>
<p>This option describes a type of exception that should <em>not</em> be handled by this
context manager. Any instance of the option's exception (or any of its derived
exception classes) will be raised immediately by <code>handle_errors</code> and will be not
be handled or processed.</p>
<p>This is useful if you want a specific variant of your <code>handle_exc_class</code> to not
be handled by <code>handle_errors</code>. For example, if you want to use
<code>handle_exc_class=Exception</code> but you do not want <code>handle_errors</code> to handle
<code>RuntimeError</code>, then, you would set <code>ignore_exc_class=RuntimeError</code>.</p>
<h4 id="do_except">do_except</h4>
<p>Often, it is useful to do some particular things when an exception is caught. Most
frequently this includes logging the exception. The <code>do_except</code> optional argument
Expand Down
22 changes: 22 additions & 0 deletions reference/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,9 @@ <h4 id="buzz.tools.handle_errors" class="doc doc-heading">
<span class="n">raise_kwargs</span><span class="p">:</span> <span class="n">Mapping</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Any</span><span class="p">]</span> <span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">handle_exc_class</span><span class="p">:</span> <span class="nb">type</span><span class="p">[</span><span class="ne">Exception</span><span class="p">]</span>
<span class="o">|</span> <span class="n">Tuple</span><span class="p">[</span><span class="nb">type</span><span class="p">[</span><span class="ne">Exception</span><span class="p">],</span> <span class="o">...</span><span class="p">]</span> <span class="o">=</span> <span class="ne">Exception</span><span class="p">,</span>
<span class="n">ignore_exc_class</span><span class="p">:</span> <span class="nb">type</span><span class="p">[</span><span class="ne">Exception</span><span class="p">]</span>
<span class="o">|</span> <span class="n">Tuple</span><span class="p">[</span><span class="nb">type</span><span class="p">[</span><span class="ne">Exception</span><span class="p">],</span> <span class="o">...</span><span class="p">]</span>
<span class="o">|</span> <span class="kc">None</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">do_finally</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[[],</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="n">noop</span><span class="p">,</span>
<span class="n">do_except</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[[</span><span class="n">DoExceptParams</span><span class="p">],</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="n">noop</span><span class="p">,</span>
<span class="n">do_else</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[[],</span> <span class="kc">None</span><span class="p">]</span> <span class="o">=</span> <span class="n">noop</span><span class="p">,</span>
Expand Down Expand Up @@ -1139,6 +1142,25 @@ <h4 id="buzz.tools.handle_errors" class="doc doc-heading">
<code>Exception</code>
</td>
</tr>
<tr>
<td><code>ignore_exc_class</code></td>
<td>
<code>type[Exception] | <span title="typing.Tuple">Tuple</span>[type[Exception], ...] | None</code>
</td>
<td>
<div class="doc-md-description">
<p>Defines an exception or set of exception types that should not be handled at all.
Any matching exception types will be immediately re-raised. They will not be handled by
the <code>handle_errors</code> context manager at all. This is useful if you want a specific variant of
your <code>handle_exc_class</code> to not be handled by <code>handle_errors</code>. For example, if you want to use
<code>handle_exc_class=Exception</code> but you do not want <code>handle_errors</code> to handle <code>RuntimeError</code>.
Then, you would set <code>ignore_exc_class=RuntimeError</code>.</p>
</div>
</td>
<td>
<code>None</code>
</td>
</tr>
<tr>
<td><code>do_finally</code></td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://py-buzz.readthedocs.io/en/latest/</loc>
<lastmod>2023-08-29</lastmod>
<lastmod>2023-09-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>http://py-buzz.readthedocs.io/en/latest/features/</loc>
<lastmod>2023-08-29</lastmod>
<lastmod>2023-09-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>http://py-buzz.readthedocs.io/en/latest/reference/</loc>
<lastmod>2023-08-29</lastmod>
<lastmod>2023-09-01</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 6203b6d

Please sign in to comment.