title: Try and Except catch all errors, except for sys.exit()
body: <p>I have created a function, but errors could pop up. That is why I want to use exceptions to generalize all errors into the same message.</p>
  
  <p>However, this function contains multiple <code>sys.exit()</code> calls.</p>
  
  <p>As a result, I would like to have my code jump into the <code>except</code> handler if an error was raised, unless it is caused by <code>sys.exit()</code>. How do I do this?</p>
  
  <pre><code>try:
     myFunction()
  except:
     print "Error running myFunction()"
  
  def myFunction():
     sys.exit("Yolo")
  </code></pre>