Home / Function/ servletExceptionIsUnwrapped() — spring-boot Function Reference

servletExceptionIsUnwrapped() — spring-boot Function Reference

Architecture documentation for the servletExceptionIsUnwrapped() function in ErrorPageFilterTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  ccf435b4_4652_7452_0941_f66de5321f2d["servletExceptionIsUnwrapped()"]
  ceb50e39_12a3_53c8_45a3_31278bc19af6["ErrorPage()"]
  ccf435b4_4652_7452_0941_f66de5321f2d -->|calls| ceb50e39_12a3_53c8_45a3_31278bc19af6
  b3fa6802_0fcb_6ddf_3e94_a5f8ad2cf83a["TestFilterChain()"]
  ccf435b4_4652_7452_0941_f66de5321f2d -->|calls| b3fa6802_0fcb_6ddf_3e94_a5f8ad2cf83a
  822a5bf1_1210_1d34_4d64_7b2af9ebd5f5["doFilter()"]
  ccf435b4_4652_7452_0941_f66de5321f2d -->|calls| 822a5bf1_1210_1d34_4d64_7b2af9ebd5f5
  b31ddfb9_cf30_450c_456a_1eb75ca296e5["getChainResponse()"]
  ccf435b4_4652_7452_0941_f66de5321f2d -->|calls| b31ddfb9_cf30_450c_456a_1eb75ca296e5
  7606f772_1e74_2d47_7ffb_917e96483136["getStatus()"]
  ccf435b4_4652_7452_0941_f66de5321f2d -->|calls| 7606f772_1e74_2d47_7ffb_917e96483136
  f5a5d09b_242f_266b_ae47_7aada2f86902["getAttributesForDispatch()"]
  ccf435b4_4652_7452_0941_f66de5321f2d -->|calls| f5a5d09b_242f_266b_ae47_7aada2f86902
  style ccf435b4_4652_7452_0941_f66de5321f2d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/test/java/org/springframework/boot/web/servlet/support/ErrorPageFilterTests.java lines 367–386

	@Test
	void servletExceptionIsUnwrapped() throws Exception {
		this.filter.addErrorPages(new ErrorPage(RuntimeException.class, "/500"));
		this.chain = new TestFilterChain((request, response, chain) -> {
			chain.call();
			throw new ServletException("Wrapper", new RuntimeException("BAD"));
		});
		this.filter.doFilter(this.request, this.response, this.chain);
		assertThat((getChainResponse()).getStatus()).isEqualTo(500);
		assertThat(this.request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE)).isEqualTo(500);
		assertThat(this.request.getAttribute(RequestDispatcher.ERROR_MESSAGE)).isEqualTo("BAD");
		Map<String, Object> requestAttributes = getAttributesForDispatch("/500");
		assertThat(requestAttributes).containsEntry(RequestDispatcher.ERROR_EXCEPTION_TYPE, RuntimeException.class);
		assertThat(requestAttributes.get(RequestDispatcher.ERROR_EXCEPTION)).isInstanceOf(RuntimeException.class);
		assertThat(this.request.getAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE)).isNull();
		assertThat(this.request.getAttribute(RequestDispatcher.ERROR_EXCEPTION)).isNull();
		assertThat(this.request.getAttribute(RequestDispatcher.ERROR_REQUEST_URI)).isEqualTo("/test/path");
		assertThat(this.response.isCommitted()).isTrue();
		assertThat(this.response.getForwardedUrl()).isEqualTo("/500");
	}

Domain

Subdomains

Frequently Asked Questions

What does servletExceptionIsUnwrapped() do?
servletExceptionIsUnwrapped() is a function in the spring-boot codebase.
What does servletExceptionIsUnwrapped() call?
servletExceptionIsUnwrapped() calls 6 function(s): ErrorPage, TestFilterChain, doFilter, getAttributesForDispatch, getChainResponse, getStatus.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free