add alerts on errors

This commit is contained in:
millmanorama 2019-03-08 12:28:09 +01:00
parent b7f1e42ab8
commit 2a30fa1a12
2 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import java.util.Objects;
import java.util.logging.Level; import java.util.logging.Level;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.control.ChoiceBox; import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ComboBox; import javafx.scene.control.ComboBox;
@ -131,6 +132,10 @@ public class AddManualEvent extends Action {
* *
* @throws IllegalArgumentException * @throws IllegalArgumentException
*/ */
@NbBundle.Messages({
"AddManualEvent.createArtifactFailed=Failed to create artifact for event.",
"AddManualEvent.postArtifactFailed=Failed to post artifact to blackboard."
})
private void addEvent(ManualEventInfo eventInfo) throws IllegalArgumentException { private void addEvent(ManualEventInfo eventInfo) throws IllegalArgumentException {
SleuthkitCase sleuthkitCase = controller.getEventsModel().getSleuthkitCase(); SleuthkitCase sleuthkitCase = controller.getEventsModel().getSleuthkitCase();
@ -154,9 +159,11 @@ public class AddManualEvent extends Action {
sleuthkitCase.getBlackboard().postArtifact(artifact, source); sleuthkitCase.getBlackboard().postArtifact(artifact, source);
} catch (Blackboard.BlackboardException ex) { } catch (Blackboard.BlackboardException ex) {
logger.log(Level.SEVERE, "Error posting artifact to the blackboard.", ex); logger.log(Level.SEVERE, "Error posting artifact to the blackboard.", ex);
new Alert(Alert.AlertType.ERROR, Bundle.AddManualEvent_postArtifactFailed(), ButtonType.OK).showAndWait();
} }
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Error creatig new artifact.", ex); logger.log(Level.SEVERE, "Error creatig new artifact.", ex);
new Alert(Alert.AlertType.ERROR, Bundle.AddManualEvent_createArtifactFailed(), ButtonType.OK).showAndWait();
} }
} }

View File

@ -1,5 +1,5 @@
#Updated by build script #Updated by build script
#Wed, 06 Mar 2019 16:04:26 +0100 #Fri, 08 Mar 2019 12:24:19 +0100
LBL_splash_window_title=Starting Autopsy LBL_splash_window_title=Starting Autopsy
SPLASH_HEIGHT=314 SPLASH_HEIGHT=314
SPLASH_WIDTH=538 SPLASH_WIDTH=538