Recognize compilation errors by a thrown error instead of parsing the output

This pull request just throws an error on `writeError()` instead of printing the error message to the output.