diff --git a/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java b/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java index 7b3d2e1..682bdf6 100644 --- a/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java +++ b/src/main/java/com/target/devicemanager/components/scanner/ScannerDevice.java @@ -217,7 +217,6 @@ protected void enable() throws JposException { LOGGER.trace(getScannerType() + "enable(in)"); if (!isConnected()) { JposException jposException = new JposException(JposConst.JPOS_E_OFFLINE); - LOGGER.error(getScannerType() + " Failed to Connect Device: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); throw jposException; } deviceListener.startEventListeners(); @@ -268,7 +267,7 @@ private void disable() throws JposException { } catch (JposException jposException) { if(isConnected()) { LOGGER.error(MARKER, getScannerType() + " Failed to Disable Device: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); - } else { + } else if(jposException.getErrorCode() != JposConst.JPOS_E_CLOSED) { LOGGER.error(getScannerType() + " Failed to Disable Device: " + jposException.getErrorCode() + ", " + jposException.getErrorCodeExtended()); } if(getScannerType().equalsIgnoreCase("HANDHELD")) { diff --git a/src/main/java/com/target/devicemanager/components/scanner/ScannerManager.java b/src/main/java/com/target/devicemanager/components/scanner/ScannerManager.java index d1c18b2..954e791 100644 --- a/src/main/java/com/target/devicemanager/components/scanner/ScannerManager.java +++ b/src/main/java/com/target/devicemanager/components/scanner/ScannerManager.java @@ -63,6 +63,11 @@ public void connect() { scanners.forEach(ScannerDevice::connect); if (connectStatus == ConnectEnum.FIRST_CONNECT) { + for (ScannerDevice scanner : scanners) { + if(!scanner.isConnected()) { + LOGGER.error(scanner.getScannerType() + " Failed to Connect"); + } + } connectStatus = ConnectEnum.CHECK_HEALTH; } }