Detect error exit on compile

This exits with a non-zero status on detecting an error (which is set by
the add_error_messages utility)

This is to resolve #279