ADD - exceptions
This commit is contained in:
parent
2e300653bd
commit
9a18f1262a
@ -0,0 +1,28 @@
|
|||||||
|
package com.banesco.application.exception;
|
||||||
|
|
||||||
|
import com.banesco.domain.interfaces.BaseStatusCodesEnum;
|
||||||
|
|
||||||
|
public class BanRuntimeException extends RuntimeException {
|
||||||
|
|
||||||
|
protected BaseStatusCodesEnum statusCode;
|
||||||
|
protected String fieldName;
|
||||||
|
protected String backendCode;
|
||||||
|
protected String statusDesc;
|
||||||
|
|
||||||
|
public BanRuntimeException() {
|
||||||
|
super("Internal Error");
|
||||||
|
}
|
||||||
|
|
||||||
|
public BanRuntimeException(BaseStatusCodesEnum statusCode, String fieldName) {
|
||||||
|
super(statusCode.getStatusDesc());
|
||||||
|
this.statusCode = statusCode;
|
||||||
|
this.fieldName = fieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BanRuntimeException(String backendCode, String statusDesc) {
|
||||||
|
super(statusDesc);
|
||||||
|
this.backendCode = backendCode;
|
||||||
|
this.statusDesc = statusDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.banesco.application.exception;
|
||||||
|
|
||||||
|
import com.banesco.domain.interfaces.BaseStatusCodesEnum;
|
||||||
|
|
||||||
|
public class InvalidDataBanException extends BanRuntimeException {
|
||||||
|
|
||||||
|
public InvalidDataBanException(BaseStatusCodesEnum statusCode, String fieldName) {
|
||||||
|
super(statusCode, fieldName);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
package com.banesco.domain.interfaces;
|
||||||
|
|
||||||
|
public interface BaseStatusCodesEnum {
|
||||||
|
String getStatusCode();
|
||||||
|
String getStatusDesc();
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user