X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FErrorHandler.cc;fp=src%2FErrorHandler.cc;h=0000000000000000000000000000000000000000;hp=d027956f046b597819218cb72f1d74b04f6be51d;hb=831f04d4bc19a390415ac0bbac4331c7a65509bc;hpb=299af4f2047e767e5d79501c26444473bda64c64 diff --git a/src/ErrorHandler.cc b/src/ErrorHandler.cc deleted file mode 100644 index d027956..0000000 --- a/src/ErrorHandler.cc +++ /dev/null @@ -1,77 +0,0 @@ - -/*] Copyright (c) 2009-2010, Charles McGarvey [************************** -**] All rights reserved. -* -* vi:ts=4 sw=4 tw=75 -* -* Distributable under the terms and conditions of the 2-clause BSD license; -* see the file COPYING for a complete text of the license. -* -**************************************************************************/ - -#include - -#include "ErrorHandler.hh" - - -std::string getErrorString(const Mf::Error& error) -{ - std::string str; - - switch(error.code()) - { - case Mf::Error::ALC_INIT: - str += "An error occurred during OpenAL initialization: "; - str += error.what(); - return str; - - case Mf::Error::FASTEVENTS_INIT: - case Mf::Error::SDL_INIT: - str += "An error occurred during SDL initialization: "; - str += error.what(); - return str; - - case Mf::Error::FILE_NOT_FOUND: - str += "A required file ("; - str += error.what(); - str += ") could not be found."; - return str; - - 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 += error.what(); - str += ") could not be found."; - return str; - - case Mf::Error::SCRIPT_ERROR: - str += "An error occurred in a script: "; - str == error.what(); - return str; - - case Mf::Error::SDL_VIDEOMODE: - str += "An error occurred while trying to set up the graphics."; - return str; - - case Mf::Error::UNKNOWN_AUDIO_FORMAT: - str += "An error occurred while trying to load an audio file, "; - str += error.what(); - str += "."; - return str; - - case Mf::Error::UNKNOWN_IMAGE_FORMAT: - str += "An error occurred while trying to load an image file, "; - str += error.what(); - str += "."; - return str; - } - - std::ostringstream stream; - stream << "An unknown error (code " << error.code() << ") occurred."; - return stream.str(); -} -