Print a better exception message and handle this in more cases rather than producing confusing errors when it’s unset.