Can you create steps to reproduce(or test project) this error, because when I trying to import existing role - this error not happening, it is just ok to import
Using jmix 1.5/1.5.5/1.6.2 and Postgres. Idk how do you reproduce it with cleaning id from Json, but for my case - no matter what empty id or duplicate - Json export and import just duplicates or ignoring(updating) existing row level role or create new with random uuid.
Anyway, the error “org.eclipse.persistence.exceptions.DatabaseException” seems like generic error and intercepted in jmix core before ours. I tested
But somehow this doesnt work, i guess i need more research time.
About message handle. This is pretty funny case. E.g. you can try intercept unique user id with message
databaseUniqueConstraintViolation.USER__Pkey=asda but this also wont work, but after attempt to rename it to something like this “IDX_USER__ON_ID” → All work.
So to make you exception localized for unique values you need to write second part of key from SCREAMING_SNAKE_CASE.
solution
So, instead of SEC_ROW_LEVEL_ROLE_pkey use SEC_ROW_LEVEL_ROLE_PKEY
PS
If you need help with custom excpetion handling via custom class - mention me in this thread