**Steps to replicate the issue** (include links if applicable):
* View API error statistics for helppanelquestionposter on Grafana: https://grafana.wikimedia.org/goto/yHue99wNR?orgId=1
**What happens?**:
* Observe the fact that besides typical error codes like `notloggedin` or `abusefilter_disallowed_abusefilter_warning`, the results contain "codes" like `p_br_b_La_possibilit_di_effettuare_modifiche_all_enciclopedia_con_l_utenza_Augusto_La_Spina_b_nome_utente_a_href_wiki_Indirizzo_IP_title_Indirizzo_IP_indirizzo_IP_a_o_range_di_indirizzi_IP_b_sospesa_b_p_p_Il_tuo_indirizzo_IP_attuale_130_25_184_189_p_p_La_sospensione_i_blocco_i_stata_attivata_dall_amministratore_a_href_wiki_Utente_Filtro_anti_abusi_title_Utente_Filtro_anti_abusi_Filtro_anti_abusi_a_per_...` (truncated, the actual value is much longer)
**What should have happened instead?**:
* Error codes should be elements of a fixed set, they should not be internaltionalized, and they should not contain HTML. Random long codes drive up the cardinality of metrics in Thanos, which may degrate query performance. They are also extremely awkward inthe Grafana UI.
**Other information** (browser name/version, screenshots, etc.):
* The error codes to emit the stats are returned by ApiMain::substituteResultWithError.
* The bad codes look like HTML sanitized to conform to error-code syntax. It's not clear where that happens, or why