ExceptionsCommon.h 651 B

123456789101112131415161718192021222324
  1. /*
  2. * ExceptionsCommon.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. class DLL_LINKAGE DataLoadingException: public std::runtime_error
  12. {
  13. public:
  14. using std::runtime_error::runtime_error;
  15. };
  16. class DLL_LINKAGE ModLoadingException: public DataLoadingException
  17. {
  18. public:
  19. ModLoadingException(const std::string & modName, const std::string & reason)
  20. : DataLoadingException("Mod " + modName + " is corrupted! Please disable or reinstall this mod. Reason: " + reason)
  21. {}
  22. };