HPCC-10503 Compile errors not caught cleanly

Add code fragment to catch compile errors and report it.

Signed-off-by: Attila Vamos <attila.vamos@gmail.com>
Merge pull request #5192 from AttilaVamos/HPCC-10503-fix

HPCC-10503 Compile errors not caught cleanly

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>