Python Language Exceptions: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Python Language =Overview= <code>try/except</code> is a language-level mechanism to handle errors (traceback) that may be caused by...")
 
Line 1: Line 1:
=Internal=
=Internal=
* [[Python_Language#Exceptions|Python Language]]
* [[Python_Language#Exceptions_.28try.2Fexcept.29|Python Language]]
 
=Overview=
=Overview=
<code>try/except</code> is a language-level mechanism to handle errors (traceback) that may be caused by a section of the code. This syntax eliminates tracebacks.
<code>try/except</code> is a language-level mechanism to handle errors (traceback) that may be caused by a section of the code. This syntax eliminates tracebacks.

Revision as of 23:20, 20 January 2022

Internal

Overview

try/except is a language-level mechanism to handle errors (traceback) that may be caused by a section of the code. This syntax eliminates tracebacks.

try:
  # do something
except:
  # execute if the previous block caused an error