summaryrefslogtreecommitdiff
path: root/amount.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-08 18:24:56 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:29 -0400
commite32d9e64a768f276e04fe79c14f1b28d88bd4185 (patch)
tree198f0b5a65a2eeb6f1f0a61dc59bf5111e7ae50d /amount.h
parentb737cd8e6dd185beeae902caa4eee6c4cee8bc36 (diff)
downloadfork-ledger-e32d9e64a768f276e04fe79c14f1b28d88bd4185.tar.gz
fork-ledger-e32d9e64a768f276e04fe79c14f1b28d88bd4185.tar.bz2
fork-ledger-e32d9e64a768f276e04fe79c14f1b28d88bd4185.zip
Added much better error location.
Diffstat (limited to 'amount.h')
-rw-r--r--amount.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/amount.h b/amount.h
index 360da8f9..5598043b 100644
--- a/amount.h
+++ b/amount.h
@@ -12,6 +12,7 @@
#include <exception>
#include "debug.h"
+#include "error.h"
namespace ledger {
@@ -624,15 +625,10 @@ inline std::time_t amount_t::date() const {
}
}
-class amount_error : public std::exception {
- std::string reason;
+class amount_error : public error {
public:
- amount_error(const std::string& _reason) throw() : reason(_reason) {}
+ amount_error(const std::string& reason) throw() : error(reason) {}
virtual ~amount_error() throw() {}
-
- virtual const char* what() const throw() {
- return reason.c_str();
- }
};
} // namespace ledger