Return correct status code on error and halt
Added a working example to README