title: The best way to determine exception type
body: <p>I have an exception instance and need to execute code depending on it's type. Which way is more clearly - re raise exception or isinstance check?</p>
  
  <p>re raise:</p>
  
  <pre><code>try:
      raise exception
  except OperationError as err:
      result = do_something1(err)
  except (InvalidValue, InvalidContext) as err:
      result = do_something2(err)
  except AnotherException as err:
      result = do_something3(err)
  except:
      pass
  </code></pre>
  
  <p>isinstance check:</p>
  
  <pre><code>if isinstance(exception, OperationError):
      result = do_something1(err)
  elif isinstance(exception, (InvalidValue, InvalidContext)):
      result = do_something2(err)
  elif isinstance(exception, AnotherException):
      result = do_something3(err)
  </code></pre>
  
  <p>PS. Code is used in django process_exception middleware, therefore when re-raising exception I should write <code>except:pass</code> for all unknown exceptions.</p>