make code optional argument to exitIfError