From a0d8d84b8702e97de11622f35ffd9b2ffa03e4f6 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 26 Feb 2009 05:39:13 -0400 Subject: Print more context if an automated xact fails --- src/xact.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/xact.cc') 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, -- cgit v1.2.3