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

handleRunFailure() — spring-boot Function Reference

Architecture documentation for the handleRunFailure() function in SpringApplication.java from the spring-boot codebase.

Function java GradlePlugin RunTasks calls 4 called by 1

Entity Profile

Dependency Diagram

graph TD
  05022a74_e101_acfd_dd3f_ee1812535914["handleRunFailure()"]
  89cfa04a_3922_680e_945d_5b4338252cc7["run()"]
  89cfa04a_3922_680e_945d_5b4338252cc7 -->|calls| 05022a74_e101_acfd_dd3f_ee1812535914
  a1057eb9_8bc1_4af2_9e06_f5426baf378a["handleExitCode()"]
  05022a74_e101_acfd_dd3f_ee1812535914 -->|calls| a1057eb9_8bc1_4af2_9e06_f5426baf378a
  40509e77_46d8_5818_ebec_24a84d4599b6["reportFailure()"]
  05022a74_e101_acfd_dd3f_ee1812535914 -->|calls| 40509e77_46d8_5818_ebec_24a84d4599b6
  f35cb859_7c45_aecd_4de9_9a93ed2da12f["getExceptionReporters()"]
  05022a74_e101_acfd_dd3f_ee1812535914 -->|calls| f35cb859_7c45_aecd_4de9_9a93ed2da12f
  7dbdd22f_6929_2540_3475_c564a673879d["close()"]
  05022a74_e101_acfd_dd3f_ee1812535914 -->|calls| 7dbdd22f_6929_2540_3475_c564a673879d
  style 05022a74_e101_acfd_dd3f_ee1812535914 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java lines 803–828

	private RuntimeException handleRunFailure(@Nullable ConfigurableApplicationContext context, Throwable exception,
			@Nullable SpringApplicationRunListeners listeners) {
		if (exception instanceof AbandonedRunException abandonedRunException) {
			return abandonedRunException;
		}
		try {
			try {
				handleExitCode(context, exception);
				if (listeners != null) {
					listeners.failed(context, exception);
				}
			}
			finally {
				reportFailure(getExceptionReporters(context), exception);
				if (context != null) {
					context.close();
					shutdownHook.deregisterFailedApplicationContext(context);
				}
			}
		}
		catch (Exception ex) {
			logger.warn("Unable to close ApplicationContext", ex);
		}
		return (exception instanceof RuntimeException runtimeException) ? runtimeException
				: new IllegalStateException(exception);
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does handleRunFailure() do?
handleRunFailure() is a function in the spring-boot codebase.
What does handleRunFailure() call?
handleRunFailure() calls 4 function(s): close, getExceptionReporters, handleExitCode, reportFailure.
What calls handleRunFailure()?
handleRunFailure() is called by 1 function(s): run.

Analyze Your Own Codebase

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

Try Supermodel Free