Browse Source

Exceptions

pull/187/head
Jure Šorn 9 months ago
parent
commit
fabdfe33f4
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -1416,7 +1416,7 @@ except (<exception>, [...]) as <name>: ...
* **Use `'traceback.print_exc()'` to print the full error message to stderr.**
* **Use `'print(<name>)'` to print just the cause of the exception (its arguments).**
* **Use `'logging.exception(<message>)'` to log the passed message, followed by the full error message of the caught exception. For details see [logging](#logging).**
* **Use `'sys.exc_info()'` to get exception type, object and traceback of caught exception.**
* **Use `'sys.exc_info()'` to get exception type, object, and traceback of caught exception.**
### Raising Exceptions
```python

2
index.html

@ -1207,7 +1207,7 @@ LogicOp = Enum(<span class="hljs-string">'LogicOp'</span>, {<span class="hljs-st
<li><strong>Use <code class="python hljs"><span class="hljs-string">'traceback.print_exc()'</span></code> to print the full error message to stderr.</strong></li>
<li><strong>Use <code class="python hljs"><span class="hljs-string">'print(&lt;name&gt;)'</span></code> to print just the cause of the exception (its arguments).</strong></li>
<li><strong>Use <code class="python hljs"><span class="hljs-string">'logging.exception(&lt;message&gt;)'</span></code> to log the passed message, followed by the full error message of the caught exception. For details see <a href="#logging">logging</a>.</strong></li>
<li><strong>Use <code class="python hljs"><span class="hljs-string">'sys.exc_info()'</span></code> to get exception type, object and traceback of caught exception.</strong></li>
<li><strong>Use <code class="python hljs"><span class="hljs-string">'sys.exc_info()'</span></code> to get exception type, object, and traceback of caught exception.</strong></li>
</ul>
<div><h3 id="raisingexceptions">Raising Exceptions</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">raise</span> &lt;exception&gt;
<span class="hljs-keyword">raise</span> &lt;exception&gt;()

Loading…
Cancel
Save