add compilation error reporting and configuration option to failOnError