Skip to content

Commit 9e52f92

Browse files
authored
Simplify exception handling in safeRun method
Refactor safeRun method to simplify exception handling. cleaned up the code which was mistyped
1 parent af795d9 commit 9e52f92

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

  • hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/util

hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/util/Consumers.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,10 @@ public void start(String name) {
111111

112112
private Void safeRun() {
113113
try {
114-
this.runAndDone();
115-
} catch (Throwable e) {
116-
LOG.error("Worker failed in ContextCallable wrapper", e);
117-
if (this.exception == null) {
118-
this.exception = e;
119-
}
120-
} catch (Throwable e) {
121-
LOG.error("Worker failed before runAndDone()", e);
122-
if (this.exception == null) {
123-
this.exception = e;
124-
}
125-
// exceptionHandle(e) will be called inside runAndDone()
114+
return this.runAndDone();
126115
} finally {
127116
this.latch.countDown();
128117
}
129-
return null;
130118
}
131119

132120
private Void runAndDone() {

0 commit comments

Comments
 (0)