[PATCH v2 16/35] util: use dynamic cast in error vreport