From 99313ebc6c3779f692f9f1bd70cc69a236f5eb78 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 31 Jul 2008 06:24:45 -0400 Subject: 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. --- derive.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'derive.cc') diff --git a/derive.cc b/derive.cc index 9f6aeca8..bcf8f8f3 100644 --- a/derive.cc +++ b/derive.cc @@ -18,7 +18,7 @@ entry_t * derive_new_entry(report_t& report, //added->_date = *i++; added->_date = boost::posix_time::time_from_string(*i++); if (i == end) - throw new error("Too few arguments to 'entry'"); + throw std::runtime_error("Too few arguments to 'entry'"); mask_t regexp(*i++); @@ -196,7 +196,7 @@ entry_t * derive_new_entry(report_t& report, ! added->finalize() || (matching && ! matching->journal->entry_finalize_hooks.run_hooks(*added, true))) - throw new error("Failed to finalize derived entry (check commodities)"); + throw std::runtime_error("Failed to finalize derived entry (check commodities)"); return added.release(); } -- cgit v1.2.3