Files
gerrit/java/com/google/gerrit
Edwin Kempin 7231282b35 Add specific exception for insert of duplicate external ID key
Add a DuplicateExternalIdKeyException as sublass of
OrmDuplicateKeyException which provides the duplicate external ID key to
the caller. This way for updates that add multiple external IDs the
caller can know for which external ID the insertion has failed. This is
useful for providing specific error messages to the client.

E.g. CreateAccount has 2 transactions that create external IDs just for
being able to return specific error messages to the client. With the new
exception these 2 transactions can be combined into a single transaction
(done by the follow-up change).

Tests are added to ensure that duplicate external IDs on account
creation still result in the same error response.

Change-Id: Ie02ff148606748b4df9b92a78e6a0e12c92cdb68
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-12-19 16:33:06 +01:00
..