diff options
-rw-r--r-- | paludis/util/executor.cc | 20 | ||||
-rw-r--r-- | src/clients/cave/resolve_common.cc | 17 |
2 files changed, 28 insertions, 9 deletions
diff --git a/paludis/util/executor.cc b/paludis/util/executor.cc index b6338a2ea..136de2eda 100644 --- a/paludis/util/executor.cc +++ b/paludis/util/executor.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Ciaran McCreesh + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -26,6 +26,7 @@ #include <thread> #include <mutex> #include <condition_variable> +#include <iostream> using namespace paludis; @@ -74,11 +75,20 @@ Executor::~Executor() void Executor::_one(const std::shared_ptr<Executive> executive) { - executive->execute_threaded(); + try + { + executive->execute_threaded(); - std::unique_lock<std::mutex> lock(_imp->mutex); - _imp->ready_for_post.push_back(executive); - _imp->condition.notify_all(); + std::unique_lock<std::mutex> lock(_imp->mutex); + _imp->ready_for_post.push_back(executive); + _imp->condition.notify_all(); + } + catch (const std::exception & e) + { + std::cerr << "Things are about go to horribly wrong. Got an exception inside executor: " + << e.what() << std::endl; + throw; + } } diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc index 45a779f6b..835e7674a 100644 --- a/src/clients/cave/resolve_common.cc +++ b/src/clients/cave/resolve_common.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Ciaran McCreesh + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -231,9 +231,18 @@ namespace void serialise_resolved(StringListStream & ser_stream, const Resolved & resolved) { - Serialiser ser(ser_stream); - resolved.serialise(ser); - ser_stream.nothing_more_to_write(); + try + { + Serialiser ser(ser_stream); + resolved.serialise(ser); + ser_stream.nothing_more_to_write(); + } + catch (const std::exception & e) + { + std::cerr << "Things are about go to horribly wrong. Got an exception whilst serialising: " + << e.what() << std::endl; + throw; + } } int display_resolution( |