1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 16:57:16 +01:00
SqMod/modules/ini/Common.cpp

36 lines
1.2 KiB
C++
Raw Normal View History

// ------------------------------------------------------------------------------------------------
#include "Common.hpp"
#include "Module.hpp"
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
void IniResult::Check() const
{
// Identify the error type
switch (m_Result)
{
case SI_FAIL:
_SqMod->SqThrow("Unable to %s. Probably invalid", m_Action.c_str());
break;
case SI_NOMEM:
_SqMod->SqThrow("Unable to %s. Ran out of memory", m_Action.c_str());
break;
case SI_FILE:
_SqMod->SqThrow("Unable to %s. %s", strerror(errno));
break;
case SI_BADREF:
_SqMod->SqThrow("Unable to %s. Invalid document reference", m_Action.c_str());
break;
case SI_OK:
case SI_UPDATED:
case SI_INSERTED:
break; /* These are not error messahes. */
default:
_SqMod->SqThrow("Unable to %s for some unforeseen reason", m_Action.c_str());
}
}
} // Namespace:: SqMod