Fix error handling during insertion of client IPs into the database.