Completed the TrainException class