ConstraintViolationException not handled deleting a used Review Criteria

Description

1. Log in as admin
2. Go to administration, Review Criteria
3. Add a criteria, giving it text and a severity
4. Go to a document in the editor and press Reject on a target
5. Select a review criteria option and press Confirm Rejection
6. Return to administration, Review Criteria
7. Press the trashcan button on the criteria

Actual:
Internal server error is displayed at the top. Entry is not deleted.
Log indicates
23:39:54,918 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-89) Cannot delete or update a parent row: a foreign key constraint fails (`zanata`.`HTextFlowTargetReviewComment`, CONSTRAINT `fk_tftrc_review_criteria` FOREIGN KEY (`review_criteria_id`) REFERENCES `ReviewCriteria` (`id`))

Expected:
Something else. Popup indicating the entry cannot be deleted, but will be disabled instead.

Environment

None

Assignee

Unassigned

Reporter

Damian Jansen

Labels

Tested Version/s

None

Components

Affects versions

Priority

Medium
Configure