2023-01-06 22:55:33 +01:00
|
|
|
package utility.robot_exceptions;
|
2022-12-09 01:38:11 +01:00
|
|
|
|
|
|
|
public class RobotException extends Exception{
|
2022-12-21 16:44:49 +01:00
|
|
|
robotExceptions currentType;
|
2022-12-25 19:57:20 +01:00
|
|
|
String name;
|
2022-12-21 16:44:49 +01:00
|
|
|
public RobotException(robotExceptions type, String name){
|
|
|
|
super(getMessage(type, name));
|
2022-12-25 19:57:20 +01:00
|
|
|
this.name = name;
|
2022-12-21 16:44:49 +01:00
|
|
|
this.currentType = type;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private static String getMessage(robotExceptions types, String name){
|
2023-01-02 19:51:04 +01:00
|
|
|
return name + " " + types.getMessage();
|
2022-12-09 01:38:11 +01:00
|
|
|
}
|
|
|
|
|
2022-12-25 19:57:20 +01:00
|
|
|
@Override
|
2023-01-09 23:32:30 +01:00
|
|
|
// länge auffüllen für ebene Liste
|
2022-12-25 19:57:20 +01:00
|
|
|
public String toString(){
|
|
|
|
return getMessage(this.currentType, this.name);
|
|
|
|
}
|
|
|
|
|
2022-12-09 01:38:11 +01:00
|
|
|
}
|
2022-12-21 16:44:49 +01:00
|
|
|
|