@@ -19,11 +19,11 @@ class LoadException : public std::exception {
1919 const char * message;
2020
2121 public:
22- LoadException () : message(" Unknown error\n " ) {}
23- LoadException (const std::string _message) : message(_message.std::string::c_str()) {}
24- ~LoadException () {}
25- const char * what () const noexcept override {
22+ LoadException () : LoadException(" Unknown error\n " ) {}
23+ LoadException (const std::string _message) : message(_message.std::string::c_str()) {
2624 logImportant (message);
25+ }
26+ const char * what () const noexcept override {
2727 return message;
2828 };
2929};
@@ -32,11 +32,8 @@ class LoadException : public std::exception {
3232class LibararyLoadException : LoadException {
3333 public:
3434 LibararyLoadException (const std::string _library = " " )
35- : LoadException(" Error with loading library: " + _library + ' \n ' ) {
36- SDL_LogCritical (SDL_LOG_PRIORITY_CRITICAL, " %s" , message);
37- }
35+ : LoadException(" Error with loading library: " + _library + ' \n ' ) {}
3836 const char * what () const noexcept override {
39- SDL_LogCritical (SDL_LOG_PRIORITY_CRITICAL, " %s" , message);
4037 return message;
4138 }
4239};
@@ -45,11 +42,8 @@ class LibararyLoadException : LoadException {
4542class DataLoadException : LoadException {
4643 public:
4744 DataLoadException (const std::string _dataType = " " )
48- : LoadException(" Error with load file: " + _dataType + ' \n ' ) {
49- SDL_LogError (SDL_LOG_PRIORITY_ERROR, " %s" , message);
50- }
45+ : LoadException(" Error with load file: " + _dataType + ' \n ' ) {}
5146 const char * what () const noexcept override {
52- SDL_LogError (SDL_LOG_PRIORITY_ERROR, " %s" , message);
5347 return message;
5448 }
5549};
0 commit comments