Last active
April 24, 2020 16:51
-
-
Save Raouf25/3dcf0a2987c8e7418952beb1850f8157 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lombok.Getter; | |
import lombok.Setter; | |
import lombok.extern.slf4j.Slf4j; | |
import java.util.Arrays; | |
import java.util.List; | |
@Getter | |
@Setter | |
@Slf4j | |
public class BackendException extends Exception { | |
private static final String MESSAGE = "{}: {}"; | |
private final ErrorEnum code; | |
private final List<String> additionalInfo; | |
public BackendException(ErrorEnum code, String message, Object... parameter) { | |
super(code.name()); | |
this.code = code; | |
this.additionalInfo = Arrays.asList(String.format(message, parameter)); | |
log.error(MESSAGE, code, additionalInfo, this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment