EventNotHandledException.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-04
  6. * Changed: 2023-02-07
  7. *
  8. * */
  9. #include <ls-std/core/exception/EventNotHandledException.hpp>
  10. #include <ls-std/core/exception/ExceptionMessage.hpp>
  11. ls::std::core::EventNotHandledException::EventNotHandledException() = default;
  12. ls::std::core::EventNotHandledException::EventNotHandledException(::std::string _message) : message(::std::move(_message))
  13. {}
  14. ls::std::core::EventNotHandledException::~EventNotHandledException() = default;
  15. const char *ls::std::core::EventNotHandledException::what() const noexcept
  16. {
  17. ::std::string concatenatedMessage = "EventNotHandledException thrown - ";
  18. if (this->message.empty())
  19. {
  20. concatenatedMessage = concatenatedMessage + "event was not handled - nothing happened!";
  21. }
  22. else
  23. {
  24. concatenatedMessage = concatenatedMessage + this->message;
  25. }
  26. return ExceptionMessage{concatenatedMessage}.toCharacterPointer();
  27. }