From c57a2e74b877eeca2361a5e8412ae9866541634c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 23 Sep 2004 06:34:27 -0400 Subject: shored up error checking of value expressions --- config.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'config.cc') diff --git a/config.cc b/config.cc index d8304d95..65af5d3c 100644 --- a/config.cc +++ b/config.cc @@ -171,23 +171,17 @@ void config_t::process_options(const std::string& command, try { if (! format_t::amount_expr) format_t::amount_expr = parse_value_expr(amount_expr); - if (! format_t::amount_expr) - throw value_expr_error(std::string("Failed to parse '") + - amount_expr + "'"); } catch (const value_expr_error& err) { - throw error(std::string("In value expression to -t: ") + err.what()); + throw error(std::string("In amount expression (-t): ") + err.what()); } try { if (! format_t::total_expr) format_t::total_expr = parse_value_expr(total_expr); - if (! format_t::total_expr) - throw value_expr_error(std::string("Failed to parse '") + - total_expr + "'"); } catch (const value_expr_error& err) { - throw error(std::string("In value expression to -T: ") + err.what()); + throw error(std::string("In total expression (-T): ") + err.what()); } // If downloading is to be supported, configure the updater @@ -197,7 +191,7 @@ void config_t::process_options(const std::string& command, pricing_leeway, cache_dirty); - if (format_t::date_format.empty() && ! date_format.empty()) + if (! date_format.empty()) format_t::date_format = date_format; } -- cgit v1.2.3