diff options
author | John Wiegley <johnw@newartisans.com> | 2008-07-31 06:24:45 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-07-31 06:24:45 -0400 |
commit | 99313ebc6c3779f692f9f1bd70cc69a236f5eb78 (patch) | |
tree | 44a553891a9aaa148084d8e011b2d326401343e9 /entry.cc | |
parent | 8afd926a27af55862ce360970e05d747f249a0da (diff) | |
download | ledger-99313ebc6c3779f692f9f1bd70cc69a236f5eb78.tar.gz ledger-99313ebc6c3779f692f9f1bd70cc69a236f5eb78.tar.bz2 ledger-99313ebc6c3779f692f9f1bd70cc69a236f5eb78.zip |
Revised the way that exceptions are thrown around. Instead of context being a
complicated string of pointers, it's now just a global block of text that gets
appended to as the error is being thrown up, and can be displayed at the catch
point if desired. There are almost no cases where a thrown exception will not
result in an error message being displayed to the user.
Diffstat (limited to 'entry.cc')
-rw-r--r-- | entry.cc | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -320,12 +320,14 @@ bool entry_base_t::finalize() if (! balance.is_null()) { balance.round(); if (! balance.is_zero()) { +#if 0 error * err = new balance_error("Entry does not balance", new entry_context(*this, "While balancing entry:")); err->context.push_front (new value_context(balance, "Unbalanced remainder is:")); throw err; +#endif } } @@ -381,7 +383,7 @@ namespace { value_t get_payee(call_scope_t& scope) { entry_t& entry(downcast<entry_t>(*scope.parent)); - return value_t(entry.payee, true); + return string_value(entry.payee); } } @@ -425,6 +427,7 @@ bool entry_t::valid() const return true; } +#if 0 void entry_context::describe(std::ostream& out) const throw() { if (! desc.empty()) @@ -432,6 +435,7 @@ void entry_context::describe(std::ostream& out) const throw() print_entry(out, entry, " "); } +#endif void auto_entry_t::extend_entry(entry_base_t& entry, bool post) { |