Print more context if an automated xact fails

This commit is contained in:
John Wiegley 2009-02-26 05:39:13 -04:00
parent f09c3906a2
commit a0d8d84b87

View file

@ -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,