Skip to content

Commit

Permalink
Merge pull request #42 from target/PNA-2083
Browse files Browse the repository at this point in the history
Remove Excess Logging for Disconnected Scanners
  • Loading branch information
bmcecilia3 committed Jun 11, 2024
2 parents 15bc87a + 0a24072 commit 1b4cb0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 1b4cb0a

Please sign in to comment.