In general you should be able to check response headers. if PDF is not generated you should be able to see html page that is affected by error. When PDF is generated, you will get file so headers would be different.
Content-type:application/pdf
It’s not possible to validate PDF content.
Sebastian