Hello,
I have a custom event handler which updates some database tables. If there occurs any error I use the ServiceException class to pass the error to the user. But then all the database changes are rollbacked.
throw new ServiceException(ErrorStatuses.FORBIDDEN, messages.error("CONSENT_CONTRACT_TO_MANY_ATTEMPS").getMessage());
Is there a way to keep the database changes and still pass the error to the user?
If I use the message class without the exception the statusCode is not set to 400 and the message ust occurs in the response header.
Best regards,
Chris