summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2018-07-19 22:01:31 -0700
committerJohn Wiegley <johnw@newartisans.com>2018-07-19 22:01:31 -0700
commit5d02402291a923d30e66e4b0a08975ebf22361c3 (patch)
tree1802e52ef0bbbc4ab864564a242f032d22bb8f5f /src/textual.cc
parent8283abb594fa6729b0f32938377cbd6701441ebd (diff)
parent2b981925e5350022569203c045bd31b6d365d995 (diff)
downloadfork-ledger-5d02402291a923d30e66e4b0a08975ebf22361c3.tar.gz
fork-ledger-5d02402291a923d30e66e4b0a08975ebf22361c3.tar.bz2
fork-ledger-5d02402291a923d30e66e4b0a08975ebf22361c3.zip
Merge remote-tracking branch 'origin/master' into next
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/textual.cc b/src/textual.cc
index 246db751..3416073b 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -282,6 +282,10 @@ void instance_t::parse()
std::cerr << _("Error: ") << err.what() << std::endl;
context.errors++;
+ if (! current_context.empty())
+ context.last = current_context + "\n" + err.what();
+ else
+ context.last = err.what();
}
}
@@ -2030,7 +2034,8 @@ std::size_t journal_t::read_textual(parse_context_stack_t& context_stack)
TRACE_FINISH(parsing_total, 1);
if (context_stack.get_current().errors > 0)
- throw error_count(context_stack.get_current().errors);
+ throw error_count(context_stack.get_current().errors,
+ context_stack.get_current().last);
return context_stack.get_current().count;
}