Pr_robot_factory/utility/robot_exceptions/RobotException.java

24 lines
519 B
Java
Raw Normal View History

2023-01-06 22:55:33 +01:00
package utility.robot_exceptions;
public class RobotException extends Exception{
robotExceptions currentType;
2022-12-25 19:57:20 +01:00
String name;
public RobotException(robotExceptions type, String name){
super(getMessage(type, name));
2022-12-25 19:57:20 +01:00
this.name = name;
this.currentType = type;
}
private static String getMessage(robotExceptions types, String name){
return name + " " + types.getMessage();
}
2022-12-25 19:57:20 +01:00
@Override
public String toString(){
return getMessage(this.currentType, this.name);
}
}