I wan to check if project has an error by a function

I wan to check if project has an error by a function