base/os: catch Ipc_error messages in Service class

Fixes #910
This commit is contained in:
Alexander Boettcher 2013-10-11 10:00:44 +02:00 committed by Christian Helmuth
parent c95f11418a
commit f14213b5f4
2 changed files with 35 additions and 11 deletions

View File

@ -183,13 +183,20 @@ namespace Genode {
catch (Root::Invalid_args) { throw Invalid_args(); }
catch (Root::Unavailable) { throw Unavailable(); }
catch (Root::Quota_exceeded) { throw Quota_exceeded(); }
catch (Genode::Ipc_error) { throw Unavailable(); }
}
void upgrade(Session_capability session, const char *args) {
_root->upgrade(session, args); }
void upgrade(Session_capability session, const char *args)
{
try { _root->upgrade(session, args); }
catch (Genode::Ipc_error) { throw Unavailable(); }
}
void close(Session_capability session) {
_root->close(session); }
void close(Session_capability session)
{
try { _root->close(session); }
catch (Genode::Ipc_error) { throw Blocking_canceled(); }
}
};
@ -210,13 +217,20 @@ namespace Genode {
throw Unavailable();
}
catch (Parent::Quota_exceeded) { throw Quota_exceeded(); }
catch (Genode::Ipc_error) { throw Unavailable(); }
}
void upgrade(Session_capability session, const char *args) {
env()->parent()->upgrade(session, args); }
void upgrade(Session_capability session, const char *args)
{
try { env()->parent()->upgrade(session, args); }
catch (Genode::Ipc_error) { throw Unavailable(); }
}
void close(Session_capability session) {
env()->parent()->close(session); }
void close(Session_capability session)
{
try { env()->parent()->close(session); }
catch (Genode::Ipc_error) { throw Blocking_canceled(); }
}
};
@ -256,6 +270,7 @@ namespace Genode {
catch (Root::Invalid_args) { throw Invalid_args(); }
catch (Root::Unavailable) { throw Unavailable(); }
catch (Root::Quota_exceeded) { throw Quota_exceeded(); }
catch (Genode::Ipc_error) { throw Unavailable(); }
}
void upgrade(Session_capability sc, const char *args)
@ -267,9 +282,14 @@ namespace Genode {
catch (Root::Invalid_args) { throw Invalid_args(); }
catch (Root::Unavailable) { throw Unavailable(); }
catch (Root::Quota_exceeded) { throw Quota_exceeded(); }
catch (Genode::Ipc_error) { throw Unavailable(); }
}
void close(Session_capability sc) { _root.close(sc); }
void close(Session_capability sc)
{
try { _root.close(sc); }
catch (Genode::Ipc_error) { throw Blocking_canceled(); }
}
};

View File

@ -294,6 +294,7 @@ namespace Init {
catch (Genode::Root::Invalid_args) { throw Invalid_args(); }
catch (Genode::Root::Unavailable) { throw Unavailable(); }
catch (Genode::Root::Quota_exceeded) { throw Quota_exceeded(); }
catch (Genode::Ipc_error) { throw Unavailable(); }
if (!cap.valid())
throw Unavailable();
@ -303,12 +304,15 @@ namespace Init {
void upgrade(Genode::Session_capability sc, const char *args)
{
Genode::Root_client(_root).upgrade(sc, args);
try { Genode::Root_client(_root).upgrade(sc, args); }
catch (Genode::Root::Invalid_args) { throw Invalid_args(); }
catch (Genode::Ipc_error) { throw Unavailable(); }
}
void close(Genode::Session_capability sc)
{
Genode::Root_client(_root).close(sc);
try { Genode::Root_client(_root).close(sc); }
catch (Genode::Ipc_error) { throw Genode::Blocking_canceled(); }
}
};