Add exit code parameter so that we can exit correctly if something goes wrong.
Merge pull request #26 from wei2912/proper-build-error

Add exit code parameter so that we can exit correctly if something goes wrong.