summaryrefslogtreecommitdiff
path: root/src/quotes.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-30 11:22:08 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:34 -0400
commit21af83013f3b1bae511a61b9e27224ab3de235c1 (patch)
treebf0eea45f33e7e269220adc6ce37815f7bc14a3f /src/quotes.cc
parent3ba6c2572dfc58bcd963cbc8cac1cce2f5b01dba (diff)
downloadfork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.tar.gz
fork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.tar.bz2
fork-ledger-21af83013f3b1bae511a61b9e27224ab3de235c1.zip
Did more work on the utility code.
Diffstat (limited to 'src/quotes.cc')
-rw-r--r--src/quotes.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quotes.cc b/src/quotes.cc
index 4b9eadae..21ed5998 100644
--- a/src/quotes.cc
+++ b/src/quotes.cc
@@ -55,12 +55,13 @@ void quotes_by_script::operator()(commodity_base_t& commodity,
commodity.history->last_lookup = time_now;
cache_dirty = true;
- if (price && ! price_db.empty()) {
+ if (price) {
+ assert(! price_db.empty());
+
#if defined(__GNUG__) && __GNUG__ < 3
- std::ofstream database(price_db.c_str(), ios::out | ios::app);
+ ofstream database(price_db, ios::out | ios::app);
#else
- std::ofstream database(price_db.c_str(),
- std::ios_base::out | std::ios_base::app);
+ ofstream database(price_db, std::ios_base::out | std::ios_base::app);
#endif
#if 0
// jww (2007-04-18): Need to convert to local time and print
@@ -70,10 +71,9 @@ void quotes_by_script::operator()(commodity_base_t& commodity,
#endif
}
} else {
- throw exception(string("Failed to download price for '") +
- commodity.symbol + "' (command: \"getquote " +
- commodity.symbol + "\")",
- context());
+ throw_(download_error,
+ "Failed to download price for '" << commodity.symbol <<
+ "' (command: \"getquote " << commodity.symbol << "\")");
}
}