2023-01-06 22:55:33 +01:00
|
|
|
package utility.robot_exceptions;
|
2022-12-21 16:44:49 +01:00
|
|
|
|
2023-01-06 22:55:33 +01:00
|
|
|
import java.io.Serializable;
|
2022-12-21 16:44:49 +01:00
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
2023-01-06 22:55:33 +01:00
|
|
|
public class ExceptionStorage implements Serializable {
|
2022-12-21 16:44:49 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|