Add functionality to raise error or not depending on the current environment.