It would be nice not to duplicate the error message construction logic.