puppetlabs/classifier — pull request #58 by aperiodic (2014-04-04 03:27:09+00:00)
Title: (NC-192) Uniqueness Violation

When the client tries to create a group that violates a database uniqueness constraint, return them a 409 Conflict response that explains which fields of the group violated the uniqueness constraint, the values of those fields, and the name of the violated constraint.

This is implemnted by introducing a new exception-catching middleware, `wrap-uniqueness-violation-explanations`, that catches a slingshot exception thrown by `create-group*` whenever the group creation
transaction throws either:
- a PSQLException with the postgres uniqueness_violation error code;
- a BatchUpdateException whose root cause (the last exception in the chain) is the above.