FINERACT-1971: Enhanced error logging - Attach stacktrace
This commit is contained in:
committed by
Arnold Gálovics
parent
d06b0562f1
commit
23e00ffec9
+1
-1
@@ -35,7 +35,7 @@ public class LinkedAccountRequiredExceptionMapper implements FineractExceptionMa
|
||||
|
||||
@Override
|
||||
public Response toResponse(LinkedAccountRequiredException exception) {
|
||||
log.warn("Exception: {}, Message: {}", exception.getClass().getName(), exception.getMessage());
|
||||
log.warn("Exception occurred", exception);
|
||||
final ApiGlobalErrorResponse notFoundErrorResponse = ApiGlobalErrorResponse.domainRuleViolation(
|
||||
exception.getGlobalisationMessageCode(), exception.getDefaultUserMessage(), exception.getDefaultUserMessageArgs());
|
||||
// request understood but not carried out due to it violating some
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ public class LoanIdsHardLockedExceptionMapper implements FineractExceptionMapper
|
||||
|
||||
@Override
|
||||
public Response toResponse(LoanIdsHardLockedException exception) {
|
||||
log.warn("Exception occurred", exception);
|
||||
return Response.status(HttpStatus.SC_CONFLICT)
|
||||
.entity(ApiGlobalErrorResponse.loanIsLocked(exception.getLoanIdFromRequest()).toJson()).type(MediaType.APPLICATION_JSON)
|
||||
.build();
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class MultiDisbursementDataRequiredExceptionMapper
|
||||
|
||||
@Override
|
||||
public Response toResponse(MultiDisbursementDataRequiredException exception) {
|
||||
log.warn("Exception: {}, Message: {}", exception.getClass().getName(), exception.getMessage());
|
||||
log.warn("Exception occurred", exception);
|
||||
final ApiGlobalErrorResponse notFoundErrorResponse = ApiGlobalErrorResponse.domainRuleViolation(
|
||||
exception.getGlobalisationMessageCode(), exception.getDefaultUserMessage(), exception.getDefaultUserMessageArgs());
|
||||
// request understood but not carried out due to it violating some
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class LoanAccountLockCannotBeOverruledExceptionMapper implements Exceptio
|
||||
public Response toResponse(LoanAccountLockCannotBeOverruledException exception) {
|
||||
final String globalisationMessageCode = "error.msg.invalid.request.body";
|
||||
final String defaultUserMessage = exception.getMessage();
|
||||
log.warn("Exception: {}, Message: {}", exception.getClass().getName(), defaultUserMessage);
|
||||
log.warn("Exception occurred", exception);
|
||||
|
||||
final ApiParameterError error = ApiParameterError.generalError(globalisationMessageCode, defaultUserMessage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user