private Map<String, ApiResponse> filterAndEnrichGenericMapResponseByDeclarations(HandlerMethod handlerMethod, Map<String, ApiResponse> genericMapResponse) {
		if (operationService.getJavadocProvider() != null) {
			JavadocProvider javadocProvider = operationService.getJavadocProvider();
			for (Entry<String, ApiResponse> genericResponse : genericMapResponse.entrySet()) {
				Map<String, Object> extensions = genericResponse.getValue().getExtensions();
				Collection<String> genericExceptions = (Collection<String>) extensions.get(EXTENSION_EXCEPTION_CLASSES);
				for (Class<?> declaredException : handlerMethod.getMethod().getExceptionTypes()) {
					if (genericExceptions.contains(declaredException.getName())) {
						Map<String, String> javadocThrows = javadocProvider.getMethodJavadocThrows(handlerMethod.getMethod());
						String description = javadocThrows.get(declaredException.getName());
						if (description == null)
							description = javadocThrows.get(declaredException.getSimpleName());
						if (description != null && !description.trim().isEmpty()) {
							genericResponse.getValue().setDescription(description);
						}
					}
				}
			}
		}
		return genericMapResponse;
	}
Filters the generic API responses by the declared exceptions.
If Javadoc comment found for the declaration than it overrides the default description.

@param handlerMethod      the method which can have exception declarations
@param genericMapResponse the default generic API responses
@return the filtered and enriched responses
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java