Add an exception, if a mysql query failed.