package com.crm.gateway.exception;

import com.crm.gateway.constants.Constants;

/**
 * @author houn
 */
public class ServiceException extends Exception {
    public static ServiceException exception() {
        return new ServiceException(Constants.SYSTEM_ERROR);
    }

    public static ServiceException notFoundException() {
        return new ServiceException(Constants.INFO_NOT_FOUND);
    }

    public static ServiceException exception(String msg) {
        return new ServiceException(msg);
    }

    public static ServiceException exception(String msg, Object... args) {
        return new ServiceException(msg, args);
    }


    public ServiceException(String msg) {
        super(msg);
    }

    public ServiceException(String msg, Object... args) {

        super(String.format(msg, args));
    }
}
