1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-21 20:27:13 +01:00

Adjust the Sqrat exception class to look more like the standard std::exception.

This commit is contained in:
Sandu Liviu Catalin 2016-07-08 00:55:51 +03:00
parent 7fbc37fa4b
commit e5f9fffd8e

View File

@ -402,7 +402,23 @@ public:
/// \param msg A nice error message
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Exception(const string& msg) : message(msg) {}
Exception(const SQChar * msg) noexcept : message(msg) {}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructs an exception
///
/// \param msg A nice error message
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
explicit Exception(string && msg) noexcept : message(msg) {}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Constructs an exception
///
/// \param msg A nice error message
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
explicit Exception(const string& msg) noexcept : message(msg) {}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Copy constructor
@ -410,7 +426,7 @@ public:
/// \param ex Exception to copy
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Exception(const Exception& ex) : message(ex.message) {}
Exception(const Exception& ex) noexcept : message(ex.message) {}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Returns a string identifying the exception
@ -418,10 +434,20 @@ public:
/// \return A nice error message
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const string& Message() const {
const string& Message() const noexcept {
return message;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// Returns a C string identifying the exception
///
/// \return A nice error message
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const SQChar * what() const noexcept {
return message.c_str();
}
private:
string message;