bug fixes

This commit is contained in:
2026-06-01 14:54:30 +02:00
parent cc1169f09c
commit 92276c07d8

View File

@@ -75,10 +75,6 @@ public class VelocityPaymentService {
if(errors != null && !errors.isEmpty()){
String errorMessage = errors.get(0);
if(errorMessage.contains("already exists")) {
log.warn("Customer already exists in Velocity: {}", errorMessage);
throw new AlreadyExistsException(errorMessage); // or handle as needed
}
log.error("Error creating customer: {}", errorMessage);
throw new IllegalStateException("Error creating customer: " + errorMessage);
}
@@ -86,6 +82,11 @@ public class VelocityPaymentService {
return null;
} catch (Exception e) {
log.error("Error creating customer: {}", e.getMessage(), e);
if(e.getMessage().contains("already exists")) {
log.warn("Customer already exists in Velocity: {}", e.getMessage());
throw new AlreadyExistsException(e.getMessage()); // or handle as needed
}
throw new IllegalStateException("Error creating customer: " + e.getMessage(), e);
}