mirror of
https://github.com/znc/znc.git
synced 2026-05-05 21:12:37 +02:00
Added try/catch for LoadModule
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@484 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -859,7 +859,11 @@ bool CModules::ReloadModule(const CString& sModule, const CString& sArgs, CUser*
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LoadModule(sMod, sArgs, pUser, sRetMsg)) {
|
||||
try {
|
||||
if (!LoadModule(sMod, sArgs, pUser, sRetMsg)) {
|
||||
return false;
|
||||
}
|
||||
} catch(...) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
4
User.cpp
4
User.cpp
@@ -121,7 +121,9 @@ bool CUser::Clone(const CUser& User, CString& sErrorRet) {
|
||||
|
||||
if (!pCurMod) {
|
||||
CString sModRet;
|
||||
vCurMods.LoadModule(pNewMod->GetModName(), "", this, sModRet);
|
||||
try {
|
||||
vCurMods.LoadModule(pNewMod->GetModName(), "", this, sModRet);
|
||||
} catch (...) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -810,7 +810,14 @@ void CUserSock::UserCommand(const CString& sLine) {
|
||||
}
|
||||
|
||||
CString sModRet;
|
||||
m_pUser->GetModules().LoadModule(sMod, sArgs, m_pUser, sModRet);
|
||||
|
||||
try {
|
||||
m_pUser->GetModules().LoadModule(sMod, sArgs, m_pUser, sModRet);
|
||||
} catch (CException e) {
|
||||
PutStatus("Unable to load module [" + sMod + "] [" + sModRet + "]");
|
||||
return;
|
||||
}
|
||||
|
||||
PutStatus(sModRet);
|
||||
#else
|
||||
PutStatus("Unable to load [" + sMod + "] Modules are not enabled.");
|
||||
|
||||
Reference in New Issue
Block a user