From aba5c1aa465c6ad92839fc9259a6a21d2292192e Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Tue, 29 Jan 2013 10:30:18 -0700 Subject: Fixes bugs 705 and 862. Ledger now fails if init or pricedb files are specified on the command line but not found. --- src/session.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/session.cc') diff --git a/src/session.cc b/src/session.cc index f047a540..f9815c3f 100644 --- a/src/session.cc +++ b/src/session.cc @@ -98,8 +98,12 @@ std::size_t session_t::read_data(const string& master_account) acct = journal->find_account(master_account); optional price_db_path; - if (HANDLED(price_db_)) + if (HANDLED(price_db_)){ price_db_path = resolve_path(HANDLER(price_db_).str()); + if (!exists(price_db_path.get())){ + throw_(parse_error, _f("Could not find specified price file %1%") % price_db_path); + } + } if (HANDLED(explicit)) journal->force_checking = true; -- cgit v1.2.3