- maps UniqueIndexDuplicateError and ReferenceExistsError in ToApiError, so forwarded duplicate-name creates and referenced deletes return 400 and 409 from a follower instead of 500
- replaces the hand-written error switches in the create, delete, update and patch route helpers with ToApiError
- moves the peer channel API error encoding and decoding into one cause codec registry in the raft package, covering not-found, field, duplicate index, reference exists and schema validation errors
- parses both shapes ValidationErrors marshals to, one error bare or several under Reason and Errors
- sends an unregistered cause as its message on both sides instead of a raw JSON object
- tests each mapping, a round trip for every cause class, and a duplicate-name service create through the API