Make type_error and parse_error inherit from game::error
This commit is contained in:
parent
e177c3da3d
commit
6ff8ec8748
3 changed files with 7 additions and 6 deletions
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "about.hpp"
|
||||
#include "display.hpp"
|
||||
#include "exceptions.hpp"
|
||||
#include "foreach.hpp"
|
||||
#include "game_preferences.hpp"
|
||||
#include "gettext.hpp"
|
||||
|
@ -325,10 +326,9 @@ private:
|
|||
};
|
||||
|
||||
/// Thrown when the help system fails to parse something.
|
||||
struct parse_error
|
||||
struct parse_error : public game::error
|
||||
{
|
||||
parse_error(const std::string& msg) : message(msg) {}
|
||||
std::string message;
|
||||
parse_error(const std::string& msg) : game::error(msg) {}
|
||||
};
|
||||
|
||||
/// The area where the content is shown in the help browser.
|
||||
|
|
|
@ -61,7 +61,7 @@ std::string get_call_stack()
|
|||
return res;
|
||||
}
|
||||
|
||||
type_error::type_error(const std::string& str) : message(str) {
|
||||
type_error::type_error(const std::string& str) : game::error(str) {
|
||||
std::cerr << "ERROR: " << message << "\n" << get_call_stack();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "exceptions.hpp"
|
||||
|
||||
namespace game_logic {
|
||||
class formula_callable;
|
||||
}
|
||||
|
@ -29,9 +31,8 @@ struct variant_string;
|
|||
struct variant_map;
|
||||
class variant_iterator;
|
||||
|
||||
struct type_error {
|
||||
struct type_error : public game::error {
|
||||
explicit type_error(const std::string& str);
|
||||
std::string message;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue