diff --git a/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/exception/ExceptionHandling.java b/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/exception/ExceptionHandling.java new file mode 100644 index 0000000..eb369b6 --- /dev/null +++ b/support-portal-backend/src/main/java/net/shyshkin/study/fullstack/supportportal/backend/exception/ExceptionHandling.java @@ -0,0 +1,17 @@ +package net.shyshkin.study.fullstack.supportportal.backend.exception; + +import lombok.extern.slf4j.Slf4j; +import net.shyshkin.study.fullstack.supportportal.backend.controller.UserResource; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@Slf4j +@RestControllerAdvice(basePackageClasses = {UserResource.class}) +public class ExceptionHandling { + private static final String ACCOUNT_LOCKED = "Your account has been locked. Please contact administration"; + private static final String METHOD_IS_NOT_ALLOWED = "This request method is not allowed on this endpoint. Please send a '%s' request"; + private static final String INTERNAL_SERVER_ERROR_MSG = "An error occurred while processing the request"; + private static final String INCORRECT_CREDENTIALS = "Username / password incorrect. Please try again"; + private static final String ACCOUNT_DISABLED ="Your account has been disabled. If this is an error, please contact administration"; + private static final String ERROR_PROCESSING_FILE = "Error occurred while processing file"; + private static final String NOT_ENOUGH_PERMISSION = "You do not have enough permission"; +}