title: How to get the MySQL type of error with PyMySQL?
body: <p>I'm doing a Python application with MySQL and PyMySQL and I'd like to be able to know the number of the MySQL error when I get one so that I can do something different depending on it.</p>
  
  <p>Is there a way to do that with a try-except statement or another way?</p>