If the formatting string is a part of WikiaUIDataException, moving this logic there would allow for something like
WikiaUIDataException::getInvalidParamDataMsg($templateRequiredVarName)