Skip to content

Commit 390427a

Browse files
committed
CpsFlowExecution: parseScript(): log "Method Too Large" situations more readably
1 parent 039801b commit 390427a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugin/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecution.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,15 @@ private CpsScript parseScript() throws IOException {
632632
trusted = new CpsGroovyShellFactory(this).forTrusted().build();
633633
shell = new CpsGroovyShellFactory(this).withParent(trusted).build();
634634

635-
s = (CpsScript) shell.reparse("WorkflowScript",script);
635+
s = (CpsScript) shell.reparse("WorkflowScript", script);
636636

637637
for (Entry<String, String> e : loadedScripts.entrySet()) {
638638
shell.reparse(e.getKey(), e.getValue());
639639
}
640+
} catch (groovyjarjarasm.asm.MethodTooLargeException x) {
641+
LOGGER.log(Level.SEVERE, "FAILED to parse WorkflowScript (the pipeline script) due to MethodTooLargeException: " + x.toString());
642+
closeShells();
643+
throw x;
640644
} catch (RuntimeException | Error x) {
641645
closeShells();
642646
throw x;

0 commit comments

Comments
 (0)