package ru.nbch.credit_tracker.utils.error;

import ru.nbch.credit_tracker.enums.EnumKeyMessage;
import ru.nbch.credit_tracker.enums.IEnumKeyCode;
import ru.nbch.credit_tracker.enums.XmlErrorFormat;
import ru.nbch.credit_tracker.exceptions.SignalClientException;
import ru.nbch.credit_tracker.exceptions.SignalServerException;

public class ExceptionUtils {

    public static SignalClientException clientExcp(IEnumKeyCode enumKeyCode, XmlErrorFormat xmlErrorFormat, Object... args) {
        return new SignalClientException(new EnumKeyMessage(enumKeyCode, args), xmlErrorFormat);
    }

    public static SignalServerException serverExcp(IEnumKeyCode enumKeyCode, XmlErrorFormat xmlErrorFormat, Exception cause, Object... args) {
        return new SignalServerException(new EnumKeyMessage(enumKeyCode, args), xmlErrorFormat, cause);
    }
}
