aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-19 19:28:04 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-11-19 19:28:04 +0000
commit07f0d15a91bd5ebb9d64b69e0e14debd4d19cd0f (patch)
treec05c9cc9cb6bc52e210574aef5030e2585c823ea
parentf9b33cc445a1efac0fa8f5c7f1f52c7e51f65375 (diff)
downloadpaludis-07f0d15a91bd5ebb9d64b69e0e14debd4d19cd0f.tar.gz
paludis-07f0d15a91bd5ebb9d64b69e0e14debd4d19cd0f.tar.xz
Handle errors when creating the output manager
Fixes: ticket:1041
-rw-r--r--paludis/ipc_output_manager.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/paludis/ipc_output_manager.cc b/paludis/ipc_output_manager.cc
index 5bb7d31..2465df5 100644
--- a/paludis/ipc_output_manager.cc
+++ b/paludis/ipc_output_manager.cc
@@ -254,9 +254,20 @@ IPCInputManager::_pipe_command_handler(const std::string & s)
if (_imp->output_manager)
return "Ealready constructed";
- _imp->output_manager = _imp->env->create_output_manager(*i);
- if (_imp->on_create)
- _imp->on_create(_imp->output_manager);
+ try
+ {
+ _imp->output_manager = _imp->env->create_output_manager(*i);
+ if (_imp->on_create)
+ _imp->on_create(_imp->output_manager);
+ }
+ catch (const Exception & e)
+ {
+ _imp->output_manager.reset(new StandardOutputManager);
+ if (_imp->on_create)
+ _imp->on_create(_imp->output_manager);
+
+ return "Egot exception '" + e.message() + "' (" + e.what() + ") when creating output manager";
+ }
}
_imp->copy_thread = std::make_shared<Thread>(std::bind(&IPCInputManager::_copy_thread, this));