37 lines
960 B
Java
37 lines
960 B
Java
package utility.robot_exceptions;
|
|
|
|
import java.io.Serializable;
|
|
import java.time.LocalDateTime;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
public class ExceptionStorage implements Serializable {
|
|
private RobotException message;
|
|
private LocalDateTime date;
|
|
|
|
public ExceptionStorage(RobotException message){
|
|
this.message = message;
|
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
|
|
LocalDateTime now = LocalDateTime.now();
|
|
this.date = now;
|
|
}
|
|
|
|
public void saveLatestErrorMessage(RobotException message){
|
|
this.message = message;
|
|
this.date = LocalDateTime.now();
|
|
}
|
|
|
|
public RobotException getLastErrorMessage(){
|
|
return this.message;
|
|
}
|
|
|
|
/*public boolean emptyErrorStorage(){
|
|
if(this.message != ""){
|
|
this.message = "";
|
|
this.date = LocalDateTime.now();
|
|
return true;
|
|
}else{return false;}
|
|
|
|
}*/
|
|
|
|
}
|