noux: handle rom_connection_failed gracefully

Fixes #1040
This commit is contained in:
Alexander Boettcher 2015-10-22 13:29:04 +02:00 committed by Christian Helmuth
parent 638fdeb2f5
commit 84dfb668d3
1 changed files with 7 additions and 3 deletions

View File

@ -48,10 +48,14 @@ namespace Noux {
char name[NAME_MAX_LEN];
Arg_string::find_arg(args, "filename").string(name, sizeof(name), "<noname>");
Rom_session_component *rom = new (env()->heap())
Rom_session_component(_ds_registry, name);
try {
Rom_session_component *rom = new (env()->heap())
Rom_session_component(_ds_registry, name);
return _ep.manage(rom);
return _ep.manage(rom);
} catch (Rom_connection::Rom_connection_failed) {
throw Service::Unavailable();
}
}
void upgrade(Genode::Session_capability, const char *args) { }