title: Identifying sqlalchemy.exc.OperationalError
body: <p>I'm trying to catch mysql/sqlalchemy OperationalErrors and replace handle access denied (1045) differently from connection refused (2003)</p>
  
  <pre><code>sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1045, "Access denied for user … (Background on this error at: http://sqlalche.me/e/e3q8)
  sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)") (Background on this error at: http://sqlalche.me/e/e3q8)
  </code></pre>
  
  <p>I just can't seem to find any documentation on how to tell these apart programmatically. I dived into the sources and thought I could check the value of err.orig.original_exception.errno but that was not the case.</p>
  
  <p>Edit: err.orig doesn't seem to be defined for access denied which might be a bug.</p>
  
  <pre><code>try:
    engine.scalar(select([1]))
  except sqlalchemy.exc.OperationalError as err:
    if err_______:
      print("Access Denied")
    elifif err_______:
      print("Connection Refused")
    else:
      raise
  </code></pre>
  
  <p>This issue really bugs me and even the bounty is running out with no news. I'm starting to believe it must be a bug  in sqlalchemy but the sqlalchemy documentation is not very descriptive in that regard and I'm new to sqlalchemy and python in general so it's really hard for me to tell. I couldn't find support on irc either, where do I go from here?</p>