title: If I want to bubble up a generic exception, what do i do in python?
body: <p>So let's say i have this python code:</p>
  
  <pre><code>def loopForEachFileInDirectory(self, conn):
      for filename in os.listdir(uploadedFilesDirectory):
          try:
              self.insertNewEntryForStagingFile(conn, filename)
              self.copyFilesToStagingDirectory(filename)
          except: ???
  
  def copyFilesToStagingDirectory(self, filename):
      logging.info("copying %s to youtube_ready",filename)
      try:
          shutil.copy(uploadedFilesDirectory+filename, stagingDirectory)
          logging.info("move successful")
      except shutil.Error,e:
          logging.warn("move failed for reasons \n\t%d:%s", e.args[0],e.args[1])
          raise ???
  </code></pre>
  
  <p>Now, the "loopForEachFileInDirectory" method is going to have a few more methods in it - i'm doing a bit of clean coding (cheers Robert Martin) here. What i'd like is to bubble up any exceptions from the sub-methods, and if anything happens in the main loop, bail on that loop and continue.</p>
  
  <p>The question is, what is the rule for bubbling up a generic exception? Do i just raise on its own? And if so, how do i generically throw an exception, and how do i catch and log the details of a generic exception?</p>