class WebActionControllerAdvice implements ResponseBodyAdvice<Object> {

	@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
	@ExceptionHandler(Throwable.class)
	@ResponseBody
	public MultiExecuteOutput exception(Throwable pEx){
		ExecuteOutput<?> resp = new ExecuteOutput<>();
		ExecuteError execError = constructExecError(pEx);
		String message = constructMessage(execError);
		
		if (Optional.ofNullable(exceptions).isPresent()) {			
			if (exceptions.containsKey(pEx.getClass())) {
				message = constructMessage(exceptions.get(pEx.getClass()), execError);
			} else {
				Optional<Class<?>> hierarchyclass = exceptions.keySet()
						.stream()
						.filter(c -> null != c && c.isAssignableFrom(pEx.getClass()))
						.findFirst();
			
				if (hierarchyclass.isPresent()) 
					message = constructMessage(exceptions.get(hierarchyclass.get()), execError);
			}
		} 
		execError.setMessage(message);
		logError(execError, pEx);
		resp.setExecuteException(execError);
		return defaultInterceptor.handleResponse(resp);		
	}

}