mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Remove separate storage for custom messages in exception types and store it directly in base class from <stdexcept> (#30012)
This commit is contained in:
committed by
GitHub
parent
937e618533
commit
15e995b3b3
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "Define.h"
|
||||
#include "DatabaseEnvFwd.h"
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
template <class T>
|
||||
@@ -33,16 +34,10 @@ namespace boost
|
||||
}
|
||||
}
|
||||
|
||||
class TC_DATABASE_API UpdateException : public std::exception
|
||||
class TC_DATABASE_API UpdateException : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
UpdateException(std::string const& msg) : _msg(msg) { }
|
||||
~UpdateException() throw() { }
|
||||
|
||||
char const* what() const throw() override { return _msg.c_str(); }
|
||||
|
||||
private:
|
||||
std::string const _msg;
|
||||
using std::runtime_error::runtime_error;
|
||||
};
|
||||
|
||||
enum BaseLocation
|
||||
|
||||
@@ -19,17 +19,12 @@
|
||||
#define TRINITY_AIEXCEPTION_H
|
||||
|
||||
#include "Define.h"
|
||||
#include <exception>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
||||
class TC_GAME_API InvalidAIException : public std::exception
|
||||
class TC_GAME_API InvalidAIException : public std::logic_error
|
||||
{
|
||||
public:
|
||||
InvalidAIException(char const* msg) : msg_(msg) {}
|
||||
char const* what() const noexcept override { return msg_.c_str(); }
|
||||
|
||||
private:
|
||||
std::string const msg_;
|
||||
using std::logic_error::logic_error;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user