title: How to handle exception in threads Python
body: <p>I have two threads which are calling a function and that function is creating one more thread.</p>
  <pre><code>def run(urls):
      while len(urls) != 0:
          t3 = threading.Thread(target=scrap_matches, args=(urls[-1],))
          try:
              print(&quot;URL left&quot;, threading.currentThread().getName(), len(urls))
              t3.start()
              del urls[-1]
          except:
              print(&quot;Got Exception&quot;)
  
  
  part_1, part_2 = parse(urls)
  
  print(part_1)
  print(part_2)
  
  t1 = threading.Thread(target=run, args=(part_1,))
  t2 = threading.Thread(target=run, args=(part_2,))
  
  t1.start()
  t2.start()
  
  t1.join()
  t2.join()
  
  </code></pre>
  <p>part_1 and part_2 are lists.
  When I got exception in function scrap_matches then instead of catching exception, thread breaks.
  I have searched a lot and I find few solutions but those are out of scope of my knowledge.</p>