catch DataError and ProgrammingError as well as IntegrityError

 All three can be caused by an API user sending bad data.