24 lines
518 B
Java
24 lines
518 B
Java
|
package safety.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
|
||
|
public String toString(){
|
||
|
return getMessage(this.currentType, this.name);
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|