@@ -0,0 +1,2811 @@
+package com.instinctools.padlaboris.application.exception;%0A%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport org.dozer.MappingException;%0Aimport org.springframework.dao.InvalidDataAccessApiUsageException;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.http.ResponseEntity;%0Aimport org.springframework.web.HttpRequestMethodNotSupportedException;%0Aimport org.springframework.web.bind.annotation.ControllerAdvice;%0Aimport org.springframework.web.bind.annotation.ExceptionHandler;%0A%0Aimport java.util.UUID;%0A%0A/**%0A * Exception handler.%0A */%0A@Slf4j%0A@ControllerAdvice%0Apublic class GlobalExceptionHandler %7B%0A%0A    /**%0A     * Handle %7B@link MappingException%7D.%0A     *%0A     * @param exception MappingException exception.%0A     * @return MappingException error message.%0A     */%0A    @ExceptionHandler(MappingException.class)%0A    public ResponseEntity mappingException(final MappingException exception) %7B%0A%0A        final String content = exception.getMessage();%0A%0A        log.warn(content);%0A%0A        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(content);%0A    %7D%0A%0A    /**%0A     * Handle %7B@link HttpRequestMethodNotSupportedException%7D.%0A     *%0A     * @param exception HttpRequestMethodNotSupportedException exception.%0A     * @return HttpRequestMethodNotSupportedException error message.%0A     */%0A    @ExceptionHandler(HttpRequestMethodNotSupportedException.class)%0A    public ResponseEntity noSuchMethodException(final HttpRequestMethodNotSupportedException exception) %7B%0A%0A        final String content = exception.getMessage();%0A%0A        log.warn(content);%0A%0A        return ResponseEntity.status(HttpStatus.METHOD_NOT_ALLOWED).body(content);%0A    %7D%0A%0A    /**%0A     * Handle %7B@link InvalidDataAccessApiUsageException%7D.%0A     *%0A     * @param exception InvalidDataAccessApiUsageException exception.%0A     * @return InvalidDataAccessApiUsageException error message.%0A     */%0A    @ExceptionHandler(InvalidDataAccessApiUsageException.class)%0A    public ResponseEntity invalidDataAccessApiUsageException(final InvalidDataAccessApiUsageException exception) %7B%0A%0A        final String content = exception.getMessage();%0A%0A        log.warn(content);%0A%0A        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(content);%0A    %7D%0A%0A    /**%0A     * Handle %7B@link Exception%7D.%0A     *%0A     * @param exception Exception exception.%0A     * @return Exception error message.%0A     */%0A    @ExceptionHandler(Exception.class)%0A    public ResponseEntity otherException(final Exception exception) %7B%0A%0A        final UUID errorUUID = UUID.randomUUID();%0A%0A        log.error(%22Error-Id: %7B%7D - %7B%7D%22, errorUUID, exception.getMessage(), exception);%0A%0A        final String content = %22An error occurred!!! Please contact support!!! Error-Id: %22 + errorUUID;%0A%0A        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(content);%0A    %7D%0A%7D%0A

add global exception handler