Allow TrainExtensions to raise Exception to stop training.