类 ServiceExceptionUtil

java.lang.Object
cn.jrack.core.exception.util.ServiceExceptionUtil

public class ServiceExceptionUtil extends Object
  • 构造器详细资料

    • ServiceExceptionUtil

      public ServiceExceptionUtil()
  • 方法详细资料

    • putAll

      public static void putAll(Map<Integer,String> messages)
    • put

      public static void put(Integer code, String message)
    • delete

      public static void delete(Integer code, String message)
    • exception

      public static ServiceException exception(ErrorCode errorCode)
    • exception

      public static ServiceException exception(ErrorCode errorCode, Object... params)
    • exception

      public static ServiceException exception(Integer code)
      创建指定编号的 ServiceException 的异常
      参数:
      code - 编号
      返回:
      异常
    • exception

      public static ServiceException exception(Integer code, Object... params)
      创建指定编号的 ServiceException 的异常
      参数:
      code - 编号
      params - 消息提示的占位符对应的参数
      返回:
      异常
    • exception0

      public static ServiceException exception0(Integer code, String messagePattern, Object... params)
    • doFormat

      public static String doFormat(int code, String messagePattern, Object... params)
      将错误编号对应的消息使用 params 进行格式化。
      参数:
      code - 错误编号
      messagePattern - 消息模版
      params - 参数
      返回:
      格式化后的提示