Wrap VerifyError in ScriptException (#21769)

If a bug occurs in painless compilation (not from a user, but from the
painless infrastructure), a VerifyError may be thrown when compiling the
broken generated class. This commit wraps VerifyErrors in
ScriptException so that useful information is returned to the user,
which can be passed on to the ES team for analysis.
This commit is contained in:
Ryan Ernst 2016-11-23 14:45:21 -08:00 committed by GitHub
parent ba2d772668
commit c3ec8e22b8

View File

@ -172,7 +172,7 @@ public final class PainlessScriptEngineService extends AbstractComponent impleme
}
}, COMPILATION_CONTEXT);
// Note that it is safe to catch any of the following errors since Painless is stateless.
} catch (OutOfMemoryError | StackOverflowError | Exception e) {
} catch (OutOfMemoryError | StackOverflowError | VerifyError | Exception e) {
throw convertToScriptException(scriptName == null ? scriptSource : scriptName, scriptSource, e);
}
}