	@Test(expectedExceptions = IOException.class)
	public void handlerThrowsException() throws Exception {

		try (SimpleHttpServer server = new SimpleHttpServer(new InetSocketAddress(PORT))) {
			server.addHandler(Pattern.compile("/"), new RequestHandler() {
				@Override
				public HttpResponse handleRequest(HttpRequest request, Matcher uriMatcher, ByteBuf body) throws RequestException {
					throw new RuntimeException("This should result in a 500 response.");
				}
			});

			final URL url = new URL("http://localhost:" + PORT);
			url.getContent();
		}
	}