diff options
Diffstat (limited to 'src/base/songloading')
-rw-r--r-- | src/base/songloading/songloader.cpp | 4 | ||||
-rw-r--r-- | src/base/songloading/songloader.hpp | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/base/songloading/songloader.cpp b/src/base/songloading/songloader.cpp index 0b1e34ad..c5c595d4 100644 --- a/src/base/songloading/songloader.cpp +++ b/src/base/songloading/songloader.cpp @@ -74,7 +74,7 @@ namespace usdx std::map<std::string, SongloadingStrategy*>::iterator it = strategies.find(extension); if (it == strategies.end()) { LOG4CXX_WARN(log, "No SongloadingStrategy found for file extension: '" << extension << "'"); - throw "Unknown file format."; + throw NoStrategyException("Unknown file format."); } return it->second->load_header(filename); @@ -92,7 +92,7 @@ namespace usdx std::map<std::string, SongloadingStrategy*>::iterator it = strategies.find(extension); if (it == strategies.end()) { LOG4CXX_WARN(log, "No SongloadingStrategy found for file extension: '" << extension << "'"); - throw "Unknown file format."; + throw NoStrategyException("Unknown file format."); } return it->second->load_song(song); diff --git a/src/base/songloading/songloader.hpp b/src/base/songloading/songloader.hpp index 41f7e034..bbe7dfcb 100644 --- a/src/base/songloading/songloader.hpp +++ b/src/base/songloading/songloader.hpp @@ -31,9 +31,17 @@ #include <log4cxx/logger.h> #include "songloading_strategy.hpp" #include "song.hpp" +#include "utils/base_exception.hpp" namespace usdx { + class NoStrategyException : public BaseException + { + public: + NoStrategyException(std::string message) : BaseException(message) {}; + ~NoStrategyException () throw () {}; + }; + class Songloader { private: |