23 lines
589 B
Java
23 lines
589 B
Java
|
|
package com.label.common.exception;
|
||
|
|
|
||
|
|
import lombok.Getter;
|
||
|
|
import org.springframework.http.HttpStatus;
|
||
|
|
|
||
|
|
@Getter
|
||
|
|
public class BusinessException extends RuntimeException {
|
||
|
|
private final String code;
|
||
|
|
private final HttpStatus httpStatus;
|
||
|
|
|
||
|
|
public BusinessException(String code, String message) {
|
||
|
|
super(message);
|
||
|
|
this.code = code;
|
||
|
|
this.httpStatus = HttpStatus.BAD_REQUEST;
|
||
|
|
}
|
||
|
|
|
||
|
|
public BusinessException(String code, String message, HttpStatus httpStatus) {
|
||
|
|
super(message);
|
||
|
|
this.code = code;
|
||
|
|
this.httpStatus = httpStatus;
|
||
|
|
}
|
||
|
|
}
|