]> git.localhorst.tv Git - blank.git/blobdiff - src/app/init.cpp
move common exceptions to app/error
[blank.git] / src / app / init.cpp
index 78a83e1df190d741c170c2823d7a07f578daa8e6..dfadffe16f0c1591dc76810a47c7dfbeae3c6463 100644 (file)
@@ -6,76 +6,12 @@
 #include <SDL_image.h>
 #include <SDL_net.h>
 #include <SDL_ttf.h>
+#include <string>
 #include <GL/glew.h>
 
 
-namespace {
-
-std::string sdl_error_append(std::string msg) {
-       const char *error = SDL_GetError();
-       if (*error != '\0') {
-               msg += ": ";
-               msg += error;
-               SDL_ClearError();
-       }
-       return msg;
-}
-
-std::string net_error_append(std::string msg) {
-       const char *error = SDLNet_GetError();
-       if (*error != '\0') {
-               msg += ": ";
-               msg += error;
-       }
-       return msg;
-}
-
-std::string alut_error_append(ALenum num, std::string msg) {
-       const char *error = alutGetErrorString(num);
-       if (*error != '\0') {
-               msg += ": ";
-               msg += error;
-       }
-       return msg;
-}
-
-}
-
 namespace blank {
 
-AlutError::AlutError(ALenum num)
-: std::runtime_error(alutGetErrorString(num)) {
-
-}
-
-AlutError::AlutError(ALenum num, const std::string &msg)
-: std::runtime_error(alut_error_append(num, msg)) {
-
-}
-
-
-NetError::NetError()
-: std::runtime_error(SDLNet_GetError()) {
-
-}
-
-NetError::NetError(const std::string &msg)
-: std::runtime_error(net_error_append(msg)) {
-
-}
-
-
-SDLError::SDLError()
-: std::runtime_error(SDL_GetError()) {
-
-}
-
-SDLError::SDLError(const std::string &msg)
-: std::runtime_error(sdl_error_append(msg)) {
-
-}
-
-
 InitSDL::InitSDL() {
        if (SDL_Init(SDL_INIT_EVENTS) != 0) {
                throw SDLError("SDL_Init(SDL_INIT_EVENTS)");