validator: refactor report_problem function.

Authored by nalvarez on Jan 11 2018, 12:38 AM.