]> Dogcows Code - chaz/yoink/blobdiff - src/ErrorHandler.cc
finally fixed broken main loop
[chaz/yoink] / src / ErrorHandler.cc
index 9c4452cd8c33ba4f2704ae23fd55740af4b6923f..8d0a8d9a1a9cedb1265d2a91385e411f08184541 100644 (file)
 #include "ErrorHandler.hh"
 
 
-std::string getErrorString(const Mf::Exception& e)
+std::string getErrorString(const Mf::Error& error)
 {
        std::string str;
 
-       switch(e.code())
+       switch(error.code())
        {
-               case Mf::ErrorCode::ALC_INIT:
+               case Mf::Error::ALC_INIT:
                        str += "An error occurred during OpenAL initialization: ";
-                       str += e.what();
+                       str += error.what();
                        return str;
 
-               case Mf::ErrorCode::FASTEVENTS_INIT:
-               case Mf::ErrorCode::SDL_INIT:
+               case Mf::Error::FASTEVENTS_INIT:
+               case Mf::Error::SDL_INIT:
                        str += "An error occurred during SDL initialization: ";
-                       str += e.what();
+                       str += error.what();
                        return str;
 
-               case Mf::ErrorCode::FILE_NOT_FOUND:
+               case Mf::Error::FILE_NOT_FOUND:
                        str += "A required file (";
-                       str += e.what();
+                       str += error.what();
                        str += ") could not be found.";
                        return str;
 
-               case Mf::ErrorCode::RESOURCE_NOT_FOUND:
+               case Mf::Error::OPENAL_INIT:
+                       str += "The audio library returned an error: ";
+                       str += error.what();
+                       return str;
+
+               case Mf::Error::RESOURCE_NOT_FOUND:
                        str += "A required resource (";
-                       str += e.what();
+                       str += error.what();
                        str += ") could not be found.";
                        return str;
 
-               case Mf::ErrorCode::SCRIPT_ERROR:
+               case Mf::Error::SCRIPT_ERROR:
                        str += "An error occurred in a script: ";
-                       str == e.what();
+                       str == error.what();
                        return str;
 
-               case Mf::ErrorCode::SDL_VIDEOMODE:
+               case Mf::Error::SDL_VIDEOMODE:
                        str += "An error occurred while trying to set up the video mode.";
                        return str;
 
-               case Mf::ErrorCode::UNKNOWN_AUDIO_FORMAT:
+               case Mf::Error::UNKNOWN_AUDIO_FORMAT:
                        str += "An error occurred while trying to load an audio file, ";
-                       str += e.what();
+                       str += error.what();
                        str += ".";
                        return str;
 
-               case Mf::ErrorCode::UNKNOWN_IMAGE_FORMAT:
+               case Mf::Error::UNKNOWN_IMAGE_FORMAT:
                        str += "An error occurred while trying to load an image file, ";
-                       str += e.what();
+                       str += error.what();
                        str += ".";
                        return str;
        }
 
        std::ostringstream stream;
-       stream << "An unknown error (code " << e.code() << ") occurred.";
+       stream << "An unknown error (code " << error.code() << ") occurred.";
        return stream.str();
 }
 
This page took 0.021224 seconds and 4 git commands to generate.