summaryrefslogtreecommitdiff
path: root/src/error.h
diff options
context:
space:
mode:
authorManuel Amador (Rudd-O) <rudd-o@rudd-o.com>2016-02-06 00:45:49 +0000
committerManuel Amador (Rudd-O) <rudd-o@rudd-o.com>2016-02-06 00:45:49 +0000
commit80058dfe8fb384f6e1529afa810c6a9bd08cdf88 (patch)
treec989f987b3a47854867f026ca6a9630cafe2b2fc /src/error.h
parent11151414aa70f6673b2464e938ae930d8674c915 (diff)
downloadfork-ledger-80058dfe8fb384f6e1529afa810c6a9bd08cdf88.tar.gz
fork-ledger-80058dfe8fb384f6e1529afa810c6a9bd08cdf88.tar.bz2
fork-ledger-80058dfe8fb384f6e1529afa810c6a9bd08cdf88.zip
Ensure that parse errors produce useful RuntimeErrors for Python code.
Diffstat (limited to 'src/error.h')
-rw-r--r--src/error.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/error.h b/src/error.h
index 73a0e395..26cbfafb 100644
--- a/src/error.h
+++ b/src/error.h
@@ -95,8 +95,9 @@ string source_context(const path& file,
struct error_count {
std::size_t count;
- explicit error_count(std::size_t _count) : count(_count) {}
- const char * what() const { return ""; }
+ std::string message;
+ explicit error_count(std::size_t _count, std::string _msg) : count(_count), message(_msg) {}
+ const char * what() const { return message.c_str(); }
};
} // namespace ledger