Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix load on script npe #5839

Merged
merged 2 commits into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private void initJavaCompilerClasspathIfNeeded() {
for (URL url : urls) {
CompilerUtils.addClassPath(url.getFile());
}
} catch (Exception e) {
} catch (Throwable e) {
log.error("FAILED to output class loader urls", e);
}
}
Expand All @@ -76,7 +76,7 @@ public BaseExternalType createExternalType(CustomScript customScript,
} else {
externalType = createExternalTypeFromStringWithPythonException(customScript);
}
} catch (Exception ex) {
} catch (Throwable ex) {
log.error("Failed to prepare external type '{}', exception: '{}'", customScriptInum, ExceptionUtils.getStackTrace(ex));
log.error("Script '{}'", customScript.getScript());
saveScriptError(customScript, ex, true);
Expand Down Expand Up @@ -152,19 +152,19 @@ public BaseExternalType createExternalTypeFromStringWithPythonException(CustomSc
}
}

public void saveScriptError(CustomScript customScript, Exception exception) {
public void saveScriptError(CustomScript customScript, Throwable exception) {
saveScriptError(customScript, exception, false);
}

public void saveScriptError(CustomScript customScript, Exception exception, boolean overwrite) {
public void saveScriptError(CustomScript customScript, Throwable exception, boolean overwrite) {
try {
saveScriptErrorImpl(customScript, exception, overwrite);
} catch (Exception ex) {
log.error("Failed to store script '{}' error", customScript.getInum(), ex);
}
}

protected void saveScriptErrorImpl(CustomScript customScript, Exception exception, boolean overwrite) {
protected void saveScriptErrorImpl(CustomScript customScript, Throwable exception, boolean overwrite) {
// Load entry from DN
String customScriptDn = customScript.getDn();
Class<? extends CustomScript> scriptType = customScript.getScriptType().getCustomScriptModel();
Expand Down