Improve the error message from /msg *status loadmod

Ever since r1505 our error messages when loading modules all were the same:
"Unable to find modinfo"

Improve this by giving the user all the information we offered before again. The
most useful one here is most likely the result from dlerror(). This is done by
adding a helper function CModules::OpenModule(). Most of its code is from
CModules::LoadModule() and this function and CModules::GetModInfo() now both use
this helper function for generating error messages.

This commit adds a "#warning", don't worry I'm working on it.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1596 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-08-10 18:58:55 +00:00
parent 7efd863063
commit f680f242ff
3 changed files with 103 additions and 108 deletions

View File

@@ -635,8 +635,9 @@ void CClient::UserCommand(CString& sLine) {
#ifdef _MODULES
CModInfo ModInfo;
if (!CZNC::Get().GetModules().GetModInfo(ModInfo, sMod)) {
PutStatus("Unable to find modinfo [" + sMod + "]");
CString sRetMsg;
if (!CZNC::Get().GetModules().GetModInfo(ModInfo, sMod, sRetMsg)) {
PutStatus("Unable to find modinfo [" + sMod + "] [" + sRetMsg + "]");
return;
}
@@ -676,7 +677,9 @@ void CClient::UserCommand(CString& sLine) {
}
#ifdef _MODULES
CModInfo ModInfo;
if (!CZNC::Get().GetModules().GetModInfo(ModInfo, sMod)) {
CString sRetMsg;
#warning If a module is removed while it is loaded, one can no longer unload it?
if (!CZNC::Get().GetModules().GetModInfo(ModInfo, sMod, sRetMsg)) {
PutStatus("Unable to find modinfo for [" + sMod + "]");
return;
}
@@ -719,8 +722,9 @@ void CClient::UserCommand(CString& sLine) {
}
#ifdef _MODULES
CModInfo ModInfo;
if (!CZNC::Get().GetModules().GetModInfo(ModInfo, sMod)) {
PutStatus("Unable to find modinfo for [" + sMod + "]");
CString sRetMsg;
if (!CZNC::Get().GetModules().GetModInfo(ModInfo, sMod, sRetMsg)) {
PutStatus("Unable to find modinfo for [" + sMod + "] [" + sRetMsg + "]");
return;
}