It's a very general class of errors and not all of them can be found in the general case. You can certainly use Preflight in Acrobat to check if the file is valid ("Detect Syntax Errors")
The SDK for automating Acrobat, so you would have to open it to validate it.