Handle commit validation errors when publishing change edit

When a commit validator throws a CommitValidationException during
publish of a new patch set from the inline editor, it is translated
to an InvalidChangeOperationException which results in an internal
server error message being displayed to the user.

Instead, catch the InvalidChangeOperationException and throw a
ResourceConflictException, which results in the actual error message
being displayed to the user.

The corresponding change in the cookbook plugin includes an example
of commit validation to reproduce this case.

Bug: Issue 3442
Change-Id: I95b88dc6f2bc76df088ebef50a52974b33cab5ad
3 files changed