diff --git a/README.md b/README.md index b9ae928..ccb36b5 100644 --- a/README.md +++ b/README.md @@ -1409,9 +1409,10 @@ except (<exception>, [...]): ... except (<exception>, [...]) as <name>: ... ``` * **Also catches subclasses of the exception.** -* **Use `'traceback.print_exc()'` to print the error message to stderr.** +* **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.** +* **Use `'sys.exc_info()'` to get exception type, object and traceback of caught exception.** ### Raising Exceptions ```python diff --git a/index.html b/index.html index 8eff0f8..6ef9991 100644 --- a/index.html +++ b/index.html @@ -54,7 +54,7 @@ <body> <header> - <aside>March 15, 2024</aside> + <aside>March 17, 2024</aside> <a href="https://gto76.github.io" rel="author">Jure Šorn</a> </header> @@ -1204,9 +1204,10 @@ LogicOp = Enum(<span class="hljs-string">'LogicOp'</span>, {<span class="hljs-st <ul> <li><strong>Also catches subclasses of the exception.</strong></li> -<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> +<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(<name>)'</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(<message>)'</span></code> to log the passed message, followed by the full error message of the 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> <exception> <span class="hljs-keyword">raise</span> <exception>() @@ -2934,7 +2935,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the activ <footer> - <aside>March 15, 2024</aside> + <aside>March 17, 2024</aside> <a href="https://gto76.github.io" rel="author">Jure Šorn</a> </footer>