From e32d9e64a768f276e04fe79c14f1b28d88bd4185 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 8 Mar 2006 18:24:56 +0000 Subject: Added much better error location. --- amount.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'amount.h') diff --git a/amount.h b/amount.h index 360da8f9..5598043b 100644 --- a/amount.h +++ b/amount.h @@ -12,6 +12,7 @@ #include #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 -- cgit v1.2.3