ADD - exceptions

This commit is contained in:
atravieso 2025-04-01 09:53:25 -04:00
parent 2e300653bd
commit 9a18f1262a
3 changed files with 44 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -0,0 +1,6 @@
package com.banesco.domain.interfaces;
public interface BaseStatusCodesEnum {
String getStatusCode();
String getStatusDesc();
}