diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index 6cd46fbab4..266c0d91f2 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -253,7 +253,7 @@ final public class FiltersPanel extends JPanel { }); } } catch (NoCurrentCaseException ex) { - logger.log(Level.WARNING, "Communications Visualization Tool opened with no open case.", ex); + logger.log(Level.INFO, "Filter update cancelled. Case is closed."); } catch (TskCoreException tskCoreException) { logger.log(Level.SEVERE, "There was a error loading the datasources for the case.", tskCoreException); } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java index c8837fa13b..cca4ec0f93 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/ImageGalleryController.java @@ -657,6 +657,7 @@ public final class ImageGalleryController { @NbBundle.Messages({"BulkTask.committingDb.status=committing image/video database", "BulkTask.stopCopy.status=Stopping copy to drawable db task.", "BulkTask.errPopulating.errMsg=There was an error populating Image Gallery database."}) + /* Base abstract class for various methods of copying data into the Image gallery DB */ abstract static private class BulkTransferTask extends BackgroundTask { static private final String FILE_EXTENSION_CLAUSE = @@ -689,6 +690,10 @@ public final class ImageGalleryController { this.tskCase = tskCase; } + /** + * + * @param success true if the transfer was successful + */ abstract void cleanup(boolean success); abstract List getFiles() throws TskCoreException; diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java index 89a40977f3..d87b13e880 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/PerCaseProperties.java @@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.imagegallery; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.channels.ClosedByInterruptException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -199,7 +200,12 @@ class PerCaseProperties { try (OutputStream fos = Files.newOutputStream(getPropertyPath(moduleName))) { props.store(fos, "Changed config settings(batch)"); //NON-NLS } - } catch (IOException e) { + } + catch (ClosedByInterruptException e) { + // not logging exception because this often happens when case is closed and stack does not help with debugging + Logger.getLogger(PerCaseProperties.class.getName()).log(Level.WARNING, "Properties not saved because of interrupt"); //NON-NLS + } + catch (IOException e) { Logger.getLogger(PerCaseProperties.class.getName()).log(Level.WARNING, "Property file exists for [" + moduleName + "] at [" + getPropertyPath(moduleName) + "] but could not be loaded.", e); //NON-NLS NON-NLS NON-NLS } } @@ -225,7 +231,12 @@ class PerCaseProperties { try (OutputStream fos = Files.newOutputStream(getPropertyPath(moduleName))) { props.store(fos, "Changed config settings(single)"); //NON-NLS } - } catch (IOException e) { + } + catch (ClosedByInterruptException e) { + // not logging exception because this often happens when case is closed and stack does not help with debugging + Logger.getLogger(PerCaseProperties.class.getName()).log(Level.WARNING, "Property {0} not saved because of interrupt", settingName); //NON-NLS + } + catch (IOException e) { Logger.getLogger(PerCaseProperties.class.getName()).log(Level.WARNING, "Property file exists for [" + moduleName + "] at [" + getPropertyPath(moduleName) + "] but could not be loaded.", e); //NON-NLS NON-NLS NON-NLS } } diff --git a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java index 40dad21cf2..319a824118 100644 --- a/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java +++ b/ImageGallery/src/org/sleuthkit/autopsy/imagegallery/gui/Toolbar.java @@ -44,6 +44,7 @@ import javafx.scene.layout.Pane; import javafx.scene.text.Text; import org.controlsfx.control.PopOver; import org.openide.util.NbBundle; +import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.imagegallery.FXMLConstructor; import org.sleuthkit.autopsy.imagegallery.ImageGalleryController; @@ -144,7 +145,13 @@ public class Toolbar extends ToolBar { * * TODO (JIRA-3010): SEVERE error logged by image Gallery UI */ - LOGGER.log(Level.WARNING, "Could not create Follow Up tag menu item", ex); //NON-NLS + if (Case.isCaseOpen()) { + LOGGER.log(Level.WARNING, "Could not create Follow Up tag menu item", ex); //NON-NLS + } + else { + // don't add stack trace to log because it makes looking for real errors harder + LOGGER.log(Level.INFO, "Unable to get tag name. Case is closed."); //NON-NLS + } } tagGroupMenuButton.showingProperty().addListener(showing -> { if (tagGroupMenuButton.isShowing()) {