now add error hadlers so we can exit with non-zero status