Skip to content

Commit 8431ea7

Browse files
committed
Exceptions
1 parent a9b6ec0 commit 8431ea7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ except (<exception>, [...]) as <name>: ...
14071407
* **Also catches subclasses of the exception.**
14081408
* **Use `'traceback.print_exc()'` to print the error message to stderr.**
14091409
* **Use `'print(<name>)'` to print just the cause of the exception (its arguments).**
1410-
* **Use `'logging.exception(<message>)'` to log the exception.**
1410+
* **Use `'logging.exception(<message>)'` to log the passed message, followed by the full error message of the caught exception.**
14111411

14121412
### Raising Exceptions
14131413
```python

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@
12091209
<li><strong>Also catches subclasses of the exception.</strong></li>
12101210
<li><strong>Use <code class="python hljs"><span class="hljs-string">'traceback.print_exc()'</span></code> to print the error message to stderr.</strong></li>
12111211
<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>
1212-
<li><strong>Use <code class="python hljs"><span class="hljs-string">'logging.exception(&lt;message&gt;)'</span></code> to log the exception.</strong></li>
1212+
<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.</strong></li>
12131213
</ul>
12141214
<div><h3 id="raisingexceptions">Raising Exceptions</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">raise</span> &lt;exception&gt;
12151215
<span class="hljs-keyword">raise</span> &lt;exception&gt;()

0 commit comments

Comments
 (0)