package com.spring.infra.security.error;

import org.springframework.security.core.AuthenticationException;

import lombok.Getter;

@Getter
public class SecurityAuthException extends AuthenticationException {

    private final SecurityExceptionRule exceptionRule;

    public SecurityAuthException() {
        super(SecurityExceptionRule.SYSTEM_ERROR.getMessage());
        this.exceptionRule = SecurityExceptionRule.SYSTEM_ERROR;
    }

    public SecurityAuthException(String msg) {
        super(msg);
        this.exceptionRule = SecurityExceptionRule.SYSTEM_ERROR;
    }

    public SecurityAuthException(SecurityExceptionRule exceptionRule) {
        super(exceptionRule.getMessage());
        this.exceptionRule = exceptionRule;
    }
    
}
