2594 added logging of exceptions in regards to Anns feedback

This commit is contained in:
William Schaefer 2017-05-25 14:52:44 -04:00
parent 59d80ccb2d
commit c28d25ae0a
2 changed files with 13 additions and 3 deletions

View File

@ -1005,7 +1005,14 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
//when a range of numbers, the first 6 digits are rightpadded with 0s to 8 digits then a dash then 3 digits, the 6,7,8, digits of the end number right padded with 9s //when a range of numbers, the first 6 digits are rightpadded with 0s to 8 digits then a dash then 3 digits, the 6,7,8, digits of the end number right padded with 9s
String binName = StringUtils.rightPad(ccNumberName, 8, "0"); String binName = StringUtils.rightPad(ccNumberName, 8, "0");
binName = binName.substring(0, 8); binName = binName.substring(0, 8);
int bin = Integer.parseInt(binName); int bin;
try {
bin = Integer.parseInt(binName);
}
catch (NumberFormatException ex){
LOGGER.log(Level.WARNING, "Unable to parseInt a BIN for node selection from string binName=" + binName, ex); //NON-NLS
return;
}
CreditCards.BankIdentificationNumber binInfo = CreditCards.getBINInfo(bin); CreditCards.BankIdentificationNumber binInfo = CreditCards.getBINInfo(bin);
if (binInfo != null) { if (binInfo != null) {
int startBin = ((BINRange) binInfo).getBINstart(); int startBin = ((BINRange) binInfo).getBINstart();

View File

@ -19,6 +19,8 @@
package org.sleuthkit.autopsy.directorytree; package org.sleuthkit.autopsy.directorytree;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact;
@ -26,13 +28,13 @@ import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
/** /**
* Action for navigating the tree to view the artifact this artifact was * Action for navigating the tree to view the artifact this artifact was
* generated off of. * generated off of.
*/ */
class ViewSourceArtifactAction extends AbstractAction { class ViewSourceArtifactAction extends AbstractAction {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Logger logger = Logger.getLogger(ViewSourceArtifactAction.class.getName());
private final BlackboardArtifact artifact; private final BlackboardArtifact artifact;
ViewSourceArtifactAction(String title, final BlackboardArtifact artifact) { ViewSourceArtifactAction(String title, final BlackboardArtifact artifact) {
@ -55,6 +57,7 @@ class ViewSourceArtifactAction extends AbstractAction {
} }
} }
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
logger.log(Level.WARNING, "Unable to perform view artifact on an associated artifact of " + artifact.getDisplayName(), ex); //NON-NLS
} }
} }