static WebAppContext newWebAppContext() throws MalformedURLException {
        final WebAppContext handler = new WebAppContext();
        handler.setContextPath("/");
        handler.setBaseResourceAsPath(webAppRoot().toPath());
        final Path helloJar = new File(webAppRoot(),
                                       "WEB-INF" + File.separatorChar +
                                       "lib" + File.separatorChar +
                                       "hello.jar").toPath();
        handler.setClassLoader(new URLClassLoader(new URL[] {
                ResourceFactory.root().newResource(helloJar).getURI().toURL()
        }, JettyService.class.getClassLoader()));
        return handler;
    }
Captures the exception raised in a Jetty handler block.
jetty/jetty12/src/test/java/com/linecorp/armeria/server/jetty/JettyServiceTest.java