objectbox / objectbox/objectbox-java

UniqueViolationException: insert the id of the duplicate document in an attribute

Open
#1,039 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
4.6k
Forks
311
PR merge metrics
No merged PRs in 30d

Description

UniqueViolationException currently in the instances created by objectbox itself in the error message is the id that conflicts with the document we want to insert, I wonder if it is possible to add this id as an attribute of the UniqueViolationException class, it would be useful.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the UniqueViolationException class and the code that constructs it for duplicate documents. Determine how the conflicting document ID is currently included in the error message, then add that ID as an accessible exception attribute and cover the behavior with a focused test. Done means callers can retrieve the duplicate document ID from the exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.