adding error checking to json generation for the packer run