Pr_robot_factory/utility/robot_exceptions/RobotException.java

25 lines
560 B
Java

package utility.robot_exceptions;
public class RobotException extends Exception{
robotExceptions currentType;
String name;
public RobotException(robotExceptions type, String name){
super(getMessage(type, name));
this.name = name;
this.currentType = type;
}
private static String getMessage(robotExceptions types, String name){
return name + " " + types.getMessage();
}
@Override
// länge auffüllen für ebene Liste
public String toString(){
return getMessage(this.currentType, this.name);
}
}