Mining a block with incorrect transactions

Just finished the lesson Mining PoW and Incentives. If a miner solves a block but it has something wrong with it such as a bad transaction, the miner will not receive the block rewards. How would a miner know the block was tainted?

Hey @Fengzi, hope you are ok.

Before any block is mined, the nodes verify the integrity of the data of each, if the data is complete valid then it will be sent to the miners so they can append it to the blockchain.

Carlos Z