exit with non-zero code in case of errors