don't return SQL to the user when there is an IntegrityError, DataError, or ProgrammingError

fixes #280
Should be `name=u'Waldorf'`, and the same on the next line.