return an exit code on error