code: @AfterThrowing(pointcut = "execution( * org.eclipse.hawkbit.repository.jpa.*Management.*(..))", throwing = "ex")
      // Exception for squid:S00112, squid:S1162
      // It is a AspectJ proxy which deals with exceptions.
      @SuppressWarnings({ "squid:S00112", "squid:S1162" })
      public void catchAndWrapJpaExceptionsService(final Exception ex) throws Throwable {
  
          // Workarround for EclipseLink merge where it does not throw
          // ConstraintViolationException directly in case of existing entity
          // update
          if (ex instanceof TransactionSystemException) {
              throw replaceWithCauseIfConstraintViolationException((TransactionSystemException) ex);
          }
  
          for (final Class<?> mappedEx : MAPPED_EXCEPTION_ORDER) {
  
              if (!mappedEx.isAssignableFrom(ex.getClass())) {
                  continue;
              }
  
              if (EXCEPTION_MAPPING.containsKey(mappedEx.getName())) {
                  throw (Exception) Class.forName(EXCEPTION_MAPPING.get(mappedEx.getName()))
                          .getConstructor(Throwable.class).newInstance(ex);
              }
  
              LOG.error("there is no mapping configured for exception class {}", mappedEx.getName());
              throw new GenericSpServerException(ex);
          }
  
          throw ex;
      }
docs: catch exceptions of the {@link TransactionManager} and wrap them to
  custom exceptions.
  
  @param ex
  the thrown and catched exception
  @throws Throwable