Log SQLSTATE code for errors