Use log.error() instead of log.info()

MYC-Refactor
Hammy 3 years ago
parent 75789c253a
commit e537f092ef

@ -37,7 +37,7 @@ class ClipboardUtils {
newContent = (String) clipboardContents.getTransferData(TEXT.getDataFlavor()); newContent = (String) clipboardContents.getTransferData(TEXT.getDataFlavor());
} }
} catch (UnsupportedFlavorException | IOException exp) { } catch (UnsupportedFlavorException | IOException exp) {
logger.info("Exception Thrown When Retrieving String Content", exp); logger.error("Exception Thrown When Retrieving String Content", exp);
} }
return newContent; return newContent;
@ -57,7 +57,7 @@ class ClipboardUtils {
bufferedImage = convertToBufferedImage((Image) clipboardContents.getTransferData(IMAGE.getDataFlavor())); bufferedImage = convertToBufferedImage((Image) clipboardContents.getTransferData(IMAGE.getDataFlavor()));
} }
} catch (UnsupportedFlavorException | IOException exp) { } catch (UnsupportedFlavorException | IOException exp) {
logger.info("Exception Thrown When Retrieving Image Content", exp); logger.error("Exception Thrown When Retrieving Image Content", exp);
} }
return bufferedImage; return bufferedImage;
@ -77,7 +77,7 @@ class ClipboardUtils {
fileList = (List<File>) clipboardContents.getTransferData(FILELIST.getDataFlavor()); fileList = (List<File>) clipboardContents.getTransferData(FILELIST.getDataFlavor());
} }
} catch (UnsupportedFlavorException | IOException exp) { } catch (UnsupportedFlavorException | IOException exp) {
logger.info("Exception Thrown When Retrieving File Content", exp); logger.error("Exception Thrown When Retrieving File Content", exp);
} }
return fileList; return fileList;
@ -97,7 +97,7 @@ class ClipboardUtils {
myClipboardContent.setOldContent(contents.getTransferData(FILELIST.getDataFlavor())); myClipboardContent.setOldContent(contents.getTransferData(FILELIST.getDataFlavor()));
} }
} catch (UnsupportedFlavorException | IOException exp) { } catch (UnsupportedFlavorException | IOException exp) {
exp.printStackTrace(); logger.error("Exception Thrown When Retrieving Clipboard Contents", exp);
} }
return myClipboardContent; return myClipboardContent;

@ -62,7 +62,7 @@ class ClipboardUtilsTest {
String actualStringContent = sut.getStringContent(transferableMock); String actualStringContent = sut.getStringContent(transferableMock);
verify(logger, times(1)).info(expectedExceptionMessage, expectedException); verify(logger, times(1)).error(expectedExceptionMessage, expectedException);
assertThat(actualStringContent, is(expectedStringContent)); assertThat(actualStringContent, is(expectedStringContent));
} }
@ -88,7 +88,7 @@ class ClipboardUtilsTest {
BufferedImage actualImageContent = sut.getImageContent(transferableMock); BufferedImage actualImageContent = sut.getImageContent(transferableMock);
verify(logger, times(1)).info(expectedExceptionMessage, expectedException); verify(logger, times(1)).error(expectedExceptionMessage, expectedException);
assertThat(actualImageContent, is(expectedImageContent)); assertThat(actualImageContent, is(expectedImageContent));
} }
@ -114,7 +114,7 @@ class ClipboardUtilsTest {
List<File> actualFileContent = sut.getFileContent(transferableMock); List<File> actualFileContent = sut.getFileContent(transferableMock);
verify(logger, times(1)).info(expectedExceptionMessage, expectedException); verify(logger, times(1)).error(expectedExceptionMessage, expectedException);
assertThat(actualFileContent, is(expectedFileContent)); assertThat(actualFileContent, is(expectedFileContent));
} }
} }
Loading…
Cancel
Save