Added exception catches

Catching MySqlExceptions