Note that this requires you to have a keen understanding of what "invalid data" means. This is unfortunately different from what e.g. Rails Validators detect. A user omitting their email address in an email address field is not invalid data, and it's not a "sad path". THAT'S the happy path, too. They are allowed to make mistakes.
But, a row in a USERS table with a blank email address IS invalid - it should never be allowed, and you can very easily arrange for your database to prevent it.