Skip to content

Commit

Permalink
Merge pull request #922 from philipwhiuk/qfj-exceptionNotThrowable
Browse files Browse the repository at this point in the history
Catch `Exception` not `Throwable` in `CompositeLog`
  • Loading branch information
chrjohn authored Jan 3, 2025
2 parents c4a795a + f321670 commit 8bfaf28
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions quickfixj-core/src/main/java/quickfix/CompositeLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ public void clear() {
for (Log log : logs) {
try {
log.clear();
} catch (Throwable e) {
} catch (Exception e) {
handleError(e);
}
}
}

private void handleError(Throwable e) {
private void handleError(Exception e) {
if (rethrowException) {
throw new RuntimeException(e);
}
Expand All @@ -57,7 +57,7 @@ public void onIncoming(String message) {
for (Log log : logs) {
try {
log.onIncoming(message);
} catch (Throwable e) {
} catch (Exception e) {
handleError(e);
}
}
Expand All @@ -67,7 +67,7 @@ public void onOutgoing(String message) {
for (Log log : logs) {
try {
log.onOutgoing(message);
} catch (Throwable e) {
} catch (Exception e) {
defaultLog.error(e.getMessage() + ", continuing", e);
}
}
Expand All @@ -77,7 +77,7 @@ public void onEvent(String text) {
for (Log log : logs) {
try {
log.onEvent(text);
} catch (Throwable e) {
} catch (Exception e) {
handleError(e);
}
}
Expand All @@ -87,7 +87,7 @@ public void onErrorEvent(String text) {
for (Log log : logs) {
try {
log.onErrorEvent(text);
} catch (Throwable e) {
} catch (Exception e) {
handleError(e);
}
}
Expand Down

0 comments on commit 8bfaf28

Please sign in to comment.