Skip to content

Commit

Permalink
[opt](load) catch Throwable to make load error msg more clear (apache…
Browse files Browse the repository at this point in the history
…#26821)

When doing LoadPendingTask or LoadLoadingTask, there may be some Error thrown,
such as `NoClassDefFoundError`, but previously, we only catch java's `Exception`, so
other kind of error can not be shown clearly.
  • Loading branch information
morningman authored Nov 13, 2023
1 parent 4230b8c commit fa8c3ae
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ protected void exec() {
failMsg.setMsg(e.getMessage() == null ? "" : e.getMessage());
LOG.warn(new LogBuilder(LogKey.LOAD_JOB, callback.getCallbackId())
.add("error_msg", "Failed to execute load task").build(), e);
} catch (Exception e) {
failMsg.setMsg(e.getMessage() == null ? "" : e.getMessage());
} catch (Throwable t) {
failMsg.setMsg(t.getMessage() == null ? "" : t.getMessage());
LOG.warn(new LogBuilder(LogKey.LOAD_JOB, callback.getCallbackId())
.add("error_msg", "Unexpected failed to execute load task").build(), e);
.add("error_msg", "Unexpected failed to execute load task").build(), t);
} finally {
if (!isFinished) {
// callback on pending task failed
Expand Down

0 comments on commit fa8c3ae

Please sign in to comment.