From 29e7674e56bf2b829bba22def2760d034a76e788 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 11 Mar 2024 13:53:05 +0000 Subject: Replace convertTo/stringify with non-throwing alternatives. Having these throw is terrible for ergonomics and there are loads of places where the exception was either silently ignored or not handled at all. Having a function which returns an optional and another that returns a default works a lot better imo. --- modules/webcpanel/pages/nickserv/alist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/webcpanel/pages/nickserv') diff --git a/modules/webcpanel/pages/nickserv/alist.cpp b/modules/webcpanel/pages/nickserv/alist.cpp index ddc394962..48c61d83e 100644 --- a/modules/webcpanel/pages/nickserv/alist.cpp +++ b/modules/webcpanel/pages/nickserv/alist.cpp @@ -30,7 +30,7 @@ bool WebCPanel::NickServ::Alist::OnRequest(HTTPProvider *server, const Anope::st { ++chan_count; - replacements["NUMBERS"] = stringify(chan_count); + replacements["NUMBERS"] = Anope::ToString(chan_count); replacements["CHANNELS"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name; replacements["ACCESSES"] = "Founder"; continue; @@ -42,7 +42,7 @@ bool WebCPanel::NickServ::Alist::OnRequest(HTTPProvider *server, const Anope::st ++chan_count; - replacements["NUMBERS"] = stringify(chan_count); + replacements["NUMBERS"] = Anope::ToString(chan_count); replacements["CHANNELS"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name; const ChanAccess *highest = access.Highest(); -- cgit