1 package com.supwisdom.institute.backend.common.framework.exception;
3 public class BaseException extends RuntimeException {
8 private static final long serialVersionUID = 2278568118369300446L;
10 public static final int DEFAULT_CODE = -1;
15 protected int code = -1;
17 public BaseException(int code, String msgFormat, Object... args) {
18 super(String.format(msgFormat, args));
22 public BaseException() {
26 public BaseException(String message, Throwable cause) {
27 super(message, cause);
30 public BaseException(Throwable cause) {
34 public BaseException(String message) {
38 public int getCode() {
50 public static BaseException newInstance(String msgFormat, Object... args) {
51 return new BaseException(DEFAULT_CODE, msgFormat, args);
54 public static BaseException newInstance(int code, String msgFormat, Object... args) {
55 return new BaseException(code, msgFormat, args);