Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/Errors.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
class PSERROR_Serialize_InvalidScriptValue : public PSERROR_Serialize { public: PSERROR_Serialize_InvalidScriptValue(); PSERROR_Serialize_InvalidScriptValue(const char* msg); PSRETURN getCode() const; }; | class PSERROR_Serialize_InvalidScriptValue : public PSERROR_Serialize { public: PSERROR_Serialize_InvalidScriptValue(); PSERROR_Serialize_InvalidScriptValue(const char* msg); PSRETURN getCode() const; }; | ||||
class PSERROR_Serialize_OutOfBounds : public PSERROR_Serialize { public: PSERROR_Serialize_OutOfBounds(); PSERROR_Serialize_OutOfBounds(const char* msg); PSRETURN getCode() const; }; | class PSERROR_Serialize_OutOfBounds : public PSERROR_Serialize { public: PSERROR_Serialize_OutOfBounds(); PSERROR_Serialize_OutOfBounds(const char* msg); PSRETURN getCode() const; }; | ||||
class PSERROR_Serialize_ScriptError : public PSERROR_Serialize { public: PSERROR_Serialize_ScriptError(); PSERROR_Serialize_ScriptError(const char* msg); PSRETURN getCode() const; }; | class PSERROR_Serialize_ScriptError : public PSERROR_Serialize { public: PSERROR_Serialize_ScriptError(); PSERROR_Serialize_ScriptError(const char* msg); PSRETURN getCode() const; }; | ||||
class PSERROR_System_RequiredExtensionsMissing : public PSERROR_System { public: PSERROR_System_RequiredExtensionsMissing(); PSERROR_System_RequiredExtensionsMissing(const char* msg); PSRETURN getCode() const; }; | class PSERROR_System_RequiredExtensionsMissing : public PSERROR_System { public: PSERROR_System_RequiredExtensionsMissing(); PSERROR_System_RequiredExtensionsMissing(const char* msg); PSRETURN getCode() const; }; | ||||
class PSERROR_System_SDLInitFailed : public PSERROR_System { public: PSERROR_System_SDLInitFailed(); PSERROR_System_SDLInitFailed(const char* msg); PSRETURN getCode() const; }; | class PSERROR_System_SDLInitFailed : public PSERROR_System { public: PSERROR_System_SDLInitFailed(); PSERROR_System_SDLInitFailed(const char* msg); PSRETURN getCode() const; }; | ||||
class PSERROR_System_VmodeFailed : public PSERROR_System { public: PSERROR_System_VmodeFailed(); PSERROR_System_VmodeFailed(const char* msg); PSRETURN getCode() const; }; | class PSERROR_System_VmodeFailed : public PSERROR_System { public: PSERROR_System_VmodeFailed(); PSERROR_System_VmodeFailed(const char* msg); PSRETURN getCode() const; }; | ||||
class PSERROR_Xeromyces_XMLOpenFailed : public PSERROR_Xeromyces { public: PSERROR_Xeromyces_XMLOpenFailed(); PSERROR_Xeromyces_XMLOpenFailed(const char* msg); PSRETURN getCode() const; }; | class PSERROR_Xeromyces_XMLOpenFailed : public PSERROR_Xeromyces { public: PSERROR_Xeromyces_XMLOpenFailed(); PSERROR_Xeromyces_XMLOpenFailed(const char* msg); PSRETURN getCode() const; }; | ||||
class PSERROR_Xeromyces_XMLParseError : public PSERROR_Xeromyces { public: PSERROR_Xeromyces_XMLParseError(); PSERROR_Xeromyces_XMLParseError(const char* msg); PSRETURN getCode() const; }; | class PSERROR_Xeromyces_XMLParseError : public PSERROR_Xeromyces { public: PSERROR_Xeromyces_XMLParseError(); PSERROR_Xeromyces_XMLParseError(const char* msg); PSRETURN getCode() const; }; | ||||
class PSERROR_Xeromyces_XMLValidationFailed : public PSERROR_Xeromyces { public: PSERROR_Xeromyces_XMLValidationFailed(); PSERROR_Xeromyces_XMLValidationFailed(const char* msg); PSRETURN getCode() const; }; | |||||
extern const PSRETURN PSRETURN_CVFSFile_AlreadyLoaded = 0x01000001; | extern const PSRETURN PSRETURN_CVFSFile_AlreadyLoaded = 0x01000001; | ||||
extern const PSRETURN PSRETURN_CVFSFile_LoadFailed = 0x01000002; | extern const PSRETURN PSRETURN_CVFSFile_LoadFailed = 0x01000002; | ||||
extern const PSRETURN PSRETURN_Deserialize_InvalidCharInString = 0x02000001; | extern const PSRETURN PSRETURN_Deserialize_InvalidCharInString = 0x02000001; | ||||
extern const PSRETURN PSRETURN_Deserialize_OutOfBounds = 0x02000002; | extern const PSRETURN PSRETURN_Deserialize_OutOfBounds = 0x02000002; | ||||
extern const PSRETURN PSRETURN_Deserialize_ReadFailed = 0x02000003; | extern const PSRETURN PSRETURN_Deserialize_ReadFailed = 0x02000003; | ||||
extern const PSRETURN PSRETURN_Deserialize_ScriptError = 0x02000004; | extern const PSRETURN PSRETURN_Deserialize_ScriptError = 0x02000004; | ||||
extern const PSRETURN PSRETURN_DllLoader_DllNotLoaded = 0x03000001; | extern const PSRETURN PSRETURN_DllLoader_DllNotLoaded = 0x03000001; | ||||
Show All 26 Lines | |||||
extern const PSRETURN PSRETURN_Serialize_InvalidScriptValue = 0x09000002; | extern const PSRETURN PSRETURN_Serialize_InvalidScriptValue = 0x09000002; | ||||
extern const PSRETURN PSRETURN_Serialize_OutOfBounds = 0x09000003; | extern const PSRETURN PSRETURN_Serialize_OutOfBounds = 0x09000003; | ||||
extern const PSRETURN PSRETURN_Serialize_ScriptError = 0x09000004; | extern const PSRETURN PSRETURN_Serialize_ScriptError = 0x09000004; | ||||
extern const PSRETURN PSRETURN_System_RequiredExtensionsMissing = 0x0a000001; | extern const PSRETURN PSRETURN_System_RequiredExtensionsMissing = 0x0a000001; | ||||
extern const PSRETURN PSRETURN_System_SDLInitFailed = 0x0a000002; | extern const PSRETURN PSRETURN_System_SDLInitFailed = 0x0a000002; | ||||
extern const PSRETURN PSRETURN_System_VmodeFailed = 0x0a000003; | extern const PSRETURN PSRETURN_System_VmodeFailed = 0x0a000003; | ||||
extern const PSRETURN PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001; | extern const PSRETURN PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001; | ||||
extern const PSRETURN PSRETURN_Xeromyces_XMLParseError = 0x0b000002; | extern const PSRETURN PSRETURN_Xeromyces_XMLParseError = 0x0b000002; | ||||
extern const PSRETURN PSRETURN_Xeromyces_XMLValidationFailed = 0x0b000003; | |||||
extern const PSRETURN MASK__PSRETURN_CVFSFile = 0xff000000; | extern const PSRETURN MASK__PSRETURN_CVFSFile = 0xff000000; | ||||
extern const PSRETURN CODE__PSRETURN_CVFSFile = 0x01000000; | extern const PSRETURN CODE__PSRETURN_CVFSFile = 0x01000000; | ||||
extern const PSRETURN MASK__PSRETURN_Deserialize = 0xff000000; | extern const PSRETURN MASK__PSRETURN_Deserialize = 0xff000000; | ||||
extern const PSRETURN CODE__PSRETURN_Deserialize = 0x02000000; | extern const PSRETURN CODE__PSRETURN_Deserialize = 0x02000000; | ||||
extern const PSRETURN MASK__PSRETURN_DllLoader = 0xff000000; | extern const PSRETURN MASK__PSRETURN_DllLoader = 0xff000000; | ||||
extern const PSRETURN CODE__PSRETURN_DllLoader = 0x03000000; | extern const PSRETURN CODE__PSRETURN_DllLoader = 0x03000000; | ||||
extern const PSRETURN MASK__PSRETURN_Error = 0xff000000; | extern const PSRETURN MASK__PSRETURN_Error = 0xff000000; | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | |||||
extern const PSRETURN MASK__PSRETURN_System_SDLInitFailed = 0xffffffff; | extern const PSRETURN MASK__PSRETURN_System_SDLInitFailed = 0xffffffff; | ||||
extern const PSRETURN CODE__PSRETURN_System_SDLInitFailed = 0x0a000002; | extern const PSRETURN CODE__PSRETURN_System_SDLInitFailed = 0x0a000002; | ||||
extern const PSRETURN MASK__PSRETURN_System_VmodeFailed = 0xffffffff; | extern const PSRETURN MASK__PSRETURN_System_VmodeFailed = 0xffffffff; | ||||
extern const PSRETURN CODE__PSRETURN_System_VmodeFailed = 0x0a000003; | extern const PSRETURN CODE__PSRETURN_System_VmodeFailed = 0x0a000003; | ||||
extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLOpenFailed = 0xffffffff; | extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLOpenFailed = 0xffffffff; | ||||
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001; | extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLOpenFailed = 0x0b000001; | ||||
extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLParseError = 0xffffffff; | extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLParseError = 0xffffffff; | ||||
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLParseError = 0x0b000002; | extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLParseError = 0x0b000002; | ||||
extern const PSRETURN MASK__PSRETURN_Xeromyces_XMLValidationFailed = 0xffffffff; | |||||
extern const PSRETURN CODE__PSRETURN_Xeromyces_XMLValidationFailed = 0x0b000003; | |||||
PSERROR_CVFSFile::PSERROR_CVFSFile(const char* msg) : PSERROR(msg) { } | PSERROR_CVFSFile::PSERROR_CVFSFile(const char* msg) : PSERROR(msg) { } | ||||
PSERROR_Deserialize::PSERROR_Deserialize(const char* msg) : PSERROR(msg) { } | PSERROR_Deserialize::PSERROR_Deserialize(const char* msg) : PSERROR(msg) { } | ||||
PSERROR_DllLoader::PSERROR_DllLoader(const char* msg) : PSERROR(msg) { } | PSERROR_DllLoader::PSERROR_DllLoader(const char* msg) : PSERROR(msg) { } | ||||
PSERROR_Error::PSERROR_Error(const char* msg) : PSERROR(msg) { } | PSERROR_Error::PSERROR_Error(const char* msg) : PSERROR(msg) { } | ||||
PSERROR_File::PSERROR_File(const char* msg) : PSERROR(msg) { } | PSERROR_File::PSERROR_File(const char* msg) : PSERROR(msg) { } | ||||
PSERROR_GUI::PSERROR_GUI(const char* msg) : PSERROR(msg) { } | PSERROR_GUI::PSERROR_GUI(const char* msg) : PSERROR(msg) { } | ||||
PSERROR_Game::PSERROR_Game(const char* msg) : PSERROR(msg) { } | PSERROR_Game::PSERROR_Game(const char* msg) : PSERROR(msg) { } | ||||
▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | |||||
PSERROR_Xeromyces_XMLOpenFailed::PSERROR_Xeromyces_XMLOpenFailed() : PSERROR_Xeromyces(NULL) { } | PSERROR_Xeromyces_XMLOpenFailed::PSERROR_Xeromyces_XMLOpenFailed() : PSERROR_Xeromyces(NULL) { } | ||||
PSERROR_Xeromyces_XMLOpenFailed::PSERROR_Xeromyces_XMLOpenFailed(const char* msg) : PSERROR_Xeromyces(msg) { } | PSERROR_Xeromyces_XMLOpenFailed::PSERROR_Xeromyces_XMLOpenFailed(const char* msg) : PSERROR_Xeromyces(msg) { } | ||||
PSRETURN PSERROR_Xeromyces_XMLOpenFailed::getCode() const { return 0x0b000001; } | PSRETURN PSERROR_Xeromyces_XMLOpenFailed::getCode() const { return 0x0b000001; } | ||||
PSERROR_Xeromyces_XMLParseError::PSERROR_Xeromyces_XMLParseError() : PSERROR_Xeromyces(NULL) { } | PSERROR_Xeromyces_XMLParseError::PSERROR_Xeromyces_XMLParseError() : PSERROR_Xeromyces(NULL) { } | ||||
PSERROR_Xeromyces_XMLParseError::PSERROR_Xeromyces_XMLParseError(const char* msg) : PSERROR_Xeromyces(msg) { } | PSERROR_Xeromyces_XMLParseError::PSERROR_Xeromyces_XMLParseError(const char* msg) : PSERROR_Xeromyces(msg) { } | ||||
PSRETURN PSERROR_Xeromyces_XMLParseError::getCode() const { return 0x0b000002; } | PSRETURN PSERROR_Xeromyces_XMLParseError::getCode() const { return 0x0b000002; } | ||||
PSERROR_Xeromyces_XMLValidationFailed::PSERROR_Xeromyces_XMLValidationFailed() : PSERROR_Xeromyces(NULL) { } | |||||
PSERROR_Xeromyces_XMLValidationFailed::PSERROR_Xeromyces_XMLValidationFailed(const char* msg) : PSERROR_Xeromyces(msg) { } | |||||
PSRETURN PSERROR_Xeromyces_XMLValidationFailed::getCode() const { return 0x0b000003; } | |||||
PSERROR::PSERROR(const char* msg) : m_msg(msg) { } | PSERROR::PSERROR(const char* msg) : m_msg(msg) { } | ||||
const char* PSERROR::what() const throw () | const char* PSERROR::what() const throw () | ||||
{ | { | ||||
return m_msg ? m_msg : GetErrorString(getCode()); | return m_msg ? m_msg : GetErrorString(getCode()); | ||||
} | } | ||||
Show All 37 Lines | const char* GetErrorString(PSRETURN code) | ||||
case 0x09000002: return "Serialize_InvalidScriptValue"; | case 0x09000002: return "Serialize_InvalidScriptValue"; | ||||
case 0x09000003: return "Serialize_OutOfBounds"; | case 0x09000003: return "Serialize_OutOfBounds"; | ||||
case 0x09000004: return "Serialize_ScriptError"; | case 0x09000004: return "Serialize_ScriptError"; | ||||
case 0x0a000001: return "System_RequiredExtensionsMissing"; | case 0x0a000001: return "System_RequiredExtensionsMissing"; | ||||
case 0x0a000002: return "System_SDLInitFailed"; | case 0x0a000002: return "System_SDLInitFailed"; | ||||
case 0x0a000003: return "System_VmodeFailed"; | case 0x0a000003: return "System_VmodeFailed"; | ||||
case 0x0b000001: return "Xeromyces_XMLOpenFailed"; | case 0x0b000001: return "Xeromyces_XMLOpenFailed"; | ||||
case 0x0b000002: return "Xeromyces_XMLParseError"; | case 0x0b000002: return "Xeromyces_XMLParseError"; | ||||
case 0x0b000003: return "Xeromyces_XMLValidationFailed"; | |||||
default: return "Unrecognised error"; | default: return "Unrecognised error"; | ||||
} | } | ||||
} | } | ||||
void ThrowError(PSRETURN code) | void ThrowError(PSRETURN code) | ||||
{ | { | ||||
switch (code) // Use 'break' in case someone tries to continue from the exception | switch (code) // Use 'break' in case someone tries to continue from the exception | ||||
Show All 34 Lines | void ThrowError(PSRETURN code) | ||||
case 0x09000002: throw PSERROR_Serialize_InvalidScriptValue(); break; | case 0x09000002: throw PSERROR_Serialize_InvalidScriptValue(); break; | ||||
case 0x09000003: throw PSERROR_Serialize_OutOfBounds(); break; | case 0x09000003: throw PSERROR_Serialize_OutOfBounds(); break; | ||||
case 0x09000004: throw PSERROR_Serialize_ScriptError(); break; | case 0x09000004: throw PSERROR_Serialize_ScriptError(); break; | ||||
case 0x0a000001: throw PSERROR_System_RequiredExtensionsMissing(); break; | case 0x0a000001: throw PSERROR_System_RequiredExtensionsMissing(); break; | ||||
case 0x0a000002: throw PSERROR_System_SDLInitFailed(); break; | case 0x0a000002: throw PSERROR_System_SDLInitFailed(); break; | ||||
case 0x0a000003: throw PSERROR_System_VmodeFailed(); break; | case 0x0a000003: throw PSERROR_System_VmodeFailed(); break; | ||||
case 0x0b000001: throw PSERROR_Xeromyces_XMLOpenFailed(); break; | case 0x0b000001: throw PSERROR_Xeromyces_XMLOpenFailed(); break; | ||||
case 0x0b000002: throw PSERROR_Xeromyces_XMLParseError(); break; | case 0x0b000002: throw PSERROR_Xeromyces_XMLParseError(); break; | ||||
case 0x0b000003: throw PSERROR_Xeromyces_XMLValidationFailed(); break; | |||||
default: throw PSERROR_Error_InvalidError(); // Hmm... | default: throw PSERROR_Error_InvalidError(); // Hmm... | ||||
} | } | ||||
} | } |
Wildfire Games · Phabricator