diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-23 06:34:27 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-23 06:34:27 -0400 |
commit | c57a2e74b877eeca2361a5e8412ae9866541634c (patch) | |
tree | df7f87bdfd71d5d004c0fe1f88cdc0f1ade934c6 /config.cc | |
parent | b4b20a6ca70fd016df05ee137e08bfe97e2e27cf (diff) | |
download | fork-ledger-c57a2e74b877eeca2361a5e8412ae9866541634c.tar.gz fork-ledger-c57a2e74b877eeca2361a5e8412ae9866541634c.tar.bz2 fork-ledger-c57a2e74b877eeca2361a5e8412ae9866541634c.zip |
shored up error checking of value expressions
Diffstat (limited to 'config.cc')
-rw-r--r-- | config.cc | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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; } |