eric-maynard commented on code in PR #243:
URL: https://github.com/apache/polaris/pull/243#discussion_r1776302020
##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java:
##########
@@ -257,6 +260,12 @@ public <T> T runInTransaction(
} finally {
localSession.remove();
}
+ } catch (PersistenceException e) {
+ if (e.toString().toLowerCase(Locale.ROOT).contains("duplicate key")) {
+ throw new AlreadyExistsException(e, "Duplicate key error when
persisting entity");
Review Comment:
IIRC from our offline discussion the dependency required to do that doesn't
exist and we didn't want to add eclipse-link specific dependencies to the
service or core modules. Rather, I would be supportive of each module
potentially bringing its own exception mapper.
Of course, I think anything is better than a 500. The important thing is
that we don't change the client-facing exception. We can always change the type
here used to map to that exception
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]