title: catch exceptions that caused by connection error in ftplib
body: <p>I'm trying to upload lots of files using python's <code>ftplib</code>.<br>
  What kind of exception should I catch to be sure the problem is a connection error (so I can re-connect)?</p>
  
  <hr>
  
  <p>Edit:<br>
  I tried <code>all_errors</code> in this scenario:  </p>
  
  <ul>
  <li>Connected to FTP server by <code>ftplib</code> and paused application (via debugger) before file upload  </li>
  <li>Closed connection via server  </li>
  <li>Resumed Application</li>
  </ul>
  
  <p>With this code:  </p>
  
  <pre><code>        try:        
              self.f.cwd(dest)
              return self.f.storbinary(('STOR '+n).encode('utf-8'), open(f,'rb'))
          except ftplib.all_errors as e:
              print e
  </code></pre>
  
  <p>exception caught but <code>all_errors</code> was empty:  </p>
  
  <pre><code>e   EOFError:   
      args    tuple: ()   
      message str:    
  </code></pre>