How to add pipeline/cook validation?

I would like to know how to add data validation to the cook pipeline. For example, let’s say that I have a DataAsset that has Texture property. If we try to cook the game and that texture is null, I want to fire an error and fail the cook. How do I do that?

I would also like to know this. There’s a Data Validator system that is run on saving an asset, but I’m not sure how to get it to be run when cooking data.