Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hr.atos.praksa.project01.businesslogic;
- public class BackendException extends RuntimeException {
- private static final long serialVersionUID = -8460356990632230194L;
- private final ErrorCode code;
- public BackendException(ErrorCode code) {
- super();
- this.code = code;
- }
- public BackendException(String message, Throwable cause, ErrorCode code) {
- super(message, cause);
- this.code = code;
- }
- public BackendException(String message, ErrorCode code) {
- super(message);
- this.code = code;
- }
- public BackendException(Throwable cause, ErrorCode code) {
- super(cause);
- this.code = code;
- }
- public ErrorCode getCode() {
- return this.code;
- }
- }
- package hr.atos.praksa.project01.businesslogic;
- public enum ErrorCode {
- VALIDATION_PARSE_ERROR(422);
- private int code;
- ErrorCode(int code) {
- this.code = code;
- }
- public int getCode() {
- return code;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement