Represents an error code functions can return and you can check.
Represents an error code functions can return and you can check. It contains some most common error codes but you can easily derive your own error class with your own errors. This class is most often used for checking whether installing some module or MASkinG itself was successfull or for checking if loading data has failed or something.
NONE - there was no error ALLEGRO - error installing Allegro KEYBOARD - error installing the keyboard module MOUSE - error installing the mouse module TIMER - error installing the timer module GFX - error setting the graphics mode SOUND - error installing the sound module (not fatal, just a warnin so to speak) MEMORY - ran out of memory VIDEOMEMORY - ran out of video memory TRIPLEBUFFER - error setting triplebuffering SKIN_INI - can't find a config file (skin) SKIN_DAT - can't find or load a datafile (skin) NO_FILE - file doesn't exist LOAD_FILE - can't load a file ALFONT - error installing or using AllegroFont INDEX - wrong index for accessing an array or vector UNKNOWN - an undetermined error (any values above UNKNOWN can be used by derived error classes)
virtual const char *MyErrror::GetDescription() {
if (type > UNKNOWN) {
return my own error description string
}
else {
return Error::GetDescription();
}
}
Error e = FunctionThatTriesToDoSomething();
if (e) {
ShutdownProgram();
}
Alphabetic index Hierarchy of classes