> But before we didn't change layers and other directives depend on this variable.

True. It may well make more sense to leave layers untouched in case of error, because, as you say, others depend on it.