private Set<Class<?>> getExceptionsFromExceptionHandler(MethodParameter methodParameter) {
		ExceptionHandler exceptionHandler = methodParameter.getExecutable().getAnnotation(ExceptionHandler.class);
		Set<Class<?>> exceptions = new HashSet<>();
		if (exceptionHandler != null) {
			if (exceptionHandler.value().length == 0) {
				for (Parameter parameter : methodParameter.getExecutable().getParameters()) {
					if (Throwable.class.isAssignableFrom(parameter.getType())) {
						exceptions.add(parameter.getType());
					}
				}
			}
			else {
				exceptions.addAll(asList(exceptionHandler.value()));
			}
		}
		return exceptions;
	}
Gets exceptions from exception handler.

@param methodParameter the method parameter
@return the exceptions from exception handler
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java