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. --- cache.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cache.cc') diff --git a/cache.cc b/cache.cc index c04bcf1c..dd29fbd7 100644 --- a/cache.cc +++ b/cache.cc @@ -727,8 +727,8 @@ std::size_t read_session(std::istream& in, // expression passed to an option, we'll just override the flags, but // keep the commodity pointer intact. if (c == commodity_t::base_t::commodities.end()) - throw new error(string("Failed to read base commodity from cache: ") + - commodity->symbol); + throw_(cache_error, "Failed to read base commodity from cache: " + << commodity->symbol); (*c).second->name = commodity->name; (*c).second->note = commodity->note; @@ -769,8 +769,8 @@ std::size_t read_session(std::istream& in, commodities_map::iterator c = commodity_t::commodities.find(mapping_key); if (c == commodity_t::commodities.end()) - throw new error(string("Failed to read commodity from cache: ") + - commodity->symbol()); + throw_(cache_error, "Failed to read commodity from cache: " + << commodity->symbol()); *(commodities_next - 1) = (*c).second; checked_delete(commodity); -- cgit v1.2.3