diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-26 05:39:13 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-26 05:39:13 -0400 |
commit | a0d8d84b8702e97de11622f35ffd9b2ffa03e4f6 (patch) | |
tree | c9c2c56d7c07320c454597ac18c6f54b18b27bdf /src/xact.cc | |
parent | f09c3906a238c32c380bd7ec47fadf78ae7c8827 (diff) | |
download | fork-ledger-a0d8d84b8702e97de11622f35ffd9b2ffa03e4f6.tar.gz fork-ledger-a0d8d84b8702e97de11622f35ffd9b2ffa03e4f6.tar.bz2 fork-ledger-a0d8d84b8702e97de11622f35ffd9b2ffa03e4f6.zip |
Print more context if an automated xact fails
Diffstat (limited to 'src/xact.cc')
-rw-r--r-- | src/xact.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xact.cc b/src/xact.cc index 52630a0e..a434da6f 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -407,6 +407,8 @@ void auto_xact_t::extend_xact(xact_base_t& xact, bool post_handler) { posts_list initial_posts(xact.posts.begin(), xact.posts.end()); + try { + foreach (post_t * initial_post, initial_posts) { if (! initial_post->has_flags(ITEM_GENERATED) && predicate(*initial_post)) { @@ -460,6 +462,13 @@ void auto_xact_t::extend_xact(xact_base_t& xact, bool post_handler) } } } + + } + catch (const std::exception& err) { + add_error_context(item_context(*this, _("While applying automated transaction"))); + add_error_context(item_context(xact, _("While extending transaction"))); + throw; + } } void extend_xact_base(journal_t * journal, |