summaryrefslogtreecommitdiff
path: root/qif.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-31 06:24:45 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-31 06:24:45 -0400
commit99313ebc6c3779f692f9f1bd70cc69a236f5eb78 (patch)
tree44a553891a9aaa148084d8e011b2d326401343e9 /qif.cc
parent8afd926a27af55862ce360970e05d747f249a0da (diff)
downloadfork-ledger-99313ebc6c3779f692f9f1bd70cc69a236f5eb78.tar.gz
fork-ledger-99313ebc6c3779f692f9f1bd70cc69a236f5eb78.tar.bz2
fork-ledger-99313ebc6c3779f692f9f1bd70cc69a236f5eb78.zip
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.
Diffstat (limited to 'qif.cc')
-rw-r--r--qif.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/qif.cc b/qif.cc
index bb8d2c55..ee9318d2 100644
--- a/qif.cc
+++ b/qif.cc
@@ -75,7 +75,7 @@ unsigned int qif_parser_t::parse(std::istream& in,
case '\t':
if (peek_next_nonws(in) != '\n') {
get_line(in);
- throw new parse_error("Line begins with whitespace");
+ throw parse_error("Line begins with whitespace");
}
// fall through...
@@ -92,8 +92,7 @@ unsigned int qif_parser_t::parse(std::istream& in,
std::strcmp(line, "Type:Cat") == 0 ||
std::strcmp(line, "Type:Class") == 0 ||
std::strcmp(line, "Type:Memorized") == 0)
- throw new parse_error(string("QIF files of type ") + line +
- " are not supported.");
+ throw_(parse_error, "QIF files of type " << line << " are not supported.");
break;
case 'D':