mirror of
https://github.com/znc/znc.git
synced 2026-08-08 18:03:22 +02:00
Don't throw any exceptions in CModules::LoadModule() on version mismatch
This also removes all the code catching those exceptions. There was nothing which justified these exceptions and removing them doesn't hurt. ByeBye CException::EX_BadModVersion git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1137 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -1295,22 +1295,16 @@ bool CZNC::DoRehash(CString& sError)
|
||||
CString sModRet;
|
||||
CString sArgs = sValue.Token(1, true);
|
||||
|
||||
try {
|
||||
bool bModRet = pUser->GetModules().LoadModule(sModName, sArgs, pUser, sModRet);
|
||||
bool bModRet = pUser->GetModules().LoadModule(sModName, sArgs, pUser, sModRet);
|
||||
|
||||
// If the module was loaded, sModRet contains
|
||||
// "Loaded Module [name] ..." and we strip away this beginning.
|
||||
if (bModRet)
|
||||
sModRet = sModRet.Token(1, true, sModName + "] ");
|
||||
// If the module was loaded, sModRet contains
|
||||
// "Loaded Module [name] ..." and we strip away this beginning.
|
||||
if (bModRet)
|
||||
sModRet = sModRet.Token(1, true, sModName + "] ");
|
||||
|
||||
CUtils::PrintStatus(bModRet, sModRet);
|
||||
if (!bModRet) {
|
||||
sError = sModRet;
|
||||
return false;
|
||||
}
|
||||
} catch (CException e) {
|
||||
sError = "Caught exception while loading [" + sModName + "]";
|
||||
CUtils::PrintStatus(false, sModRet);
|
||||
CUtils::PrintStatus(bModRet, sModRet);
|
||||
if (!bModRet) {
|
||||
sError = sModRet;
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
@@ -1486,43 +1480,31 @@ bool CZNC::DoRehash(CString& sError)
|
||||
if (!pOldMod) {
|
||||
CUtils::PrintAction("Loading Global Module [" + sModName + "]");
|
||||
|
||||
try {
|
||||
bool bModRet = GetModules().LoadModule(sModName, sArgs, NULL, sModRet);
|
||||
bool bModRet = GetModules().LoadModule(sModName, sArgs, NULL, sModRet);
|
||||
|
||||
// If the module was loaded, sModRet contains
|
||||
// "Loaded Module [name] ..." and we strip away this beginning.
|
||||
if (bModRet)
|
||||
sModRet = sModRet.Token(1, true, sModName + "] ");
|
||||
// If the module was loaded, sModRet contains
|
||||
// "Loaded Module [name] ..." and we strip away this beginning.
|
||||
if (bModRet)
|
||||
sModRet = sModRet.Token(1, true, sModName + "] ");
|
||||
|
||||
CUtils::PrintStatus(bModRet, sModRet);
|
||||
if (!bModRet) {
|
||||
sError = sModRet;
|
||||
return false;
|
||||
}
|
||||
} catch (CException e) {
|
||||
sError = "Caught an exception while loading [" + sModName + "]";
|
||||
CUtils::PrintStatus(false, sModRet);
|
||||
CUtils::PrintStatus(bModRet, sModRet);
|
||||
if (!bModRet) {
|
||||
sError = sModRet;
|
||||
return false;
|
||||
}
|
||||
} else if (pOldMod->GetArgs() != sArgs) {
|
||||
CUtils::PrintAction("Reloading Global Module [" + sModName + "]");
|
||||
|
||||
try {
|
||||
bool bModRet = GetModules().ReloadModule(sModName, sArgs, NULL, sModRet);
|
||||
bool bModRet = GetModules().ReloadModule(sModName, sArgs, NULL, sModRet);
|
||||
|
||||
// If the module was loaded, sModRet contains
|
||||
// "Loaded Module [name] ..." and we strip away this beginning.
|
||||
if (bModRet)
|
||||
sModRet = sModRet.Token(1, true, sModName + "] ");
|
||||
// If the module was loaded, sModRet contains
|
||||
// "Loaded Module [name] ..." and we strip away this beginning.
|
||||
if (bModRet)
|
||||
sModRet = sModRet.Token(1, true, sModName + "] ");
|
||||
|
||||
CUtils::PrintStatus(bModRet, sModRet);
|
||||
if (!bModRet) {
|
||||
sError = sModRet;
|
||||
return false;
|
||||
}
|
||||
} catch (CException e) {
|
||||
sError = "Caught an exception while reloading [" + sModName + "]";
|
||||
CUtils::PrintStatus(false, sModRet);
|
||||
CUtils::PrintStatus(bModRet, sModRet);
|
||||
if (!bModRet) {
|
||||
sError = sModRet;
|
||||
return false;
|
||||
}
|
||||
} else
|
||||
|
||||
Reference in New Issue
Block a user