Streamline exception types
This patch reduces the number of exception types by facilitating globally defined exceptions for common usage patterns shared by most services. In particular, RPC functions that demand a session-resource upgrade not longer reflect this condition via a session-specific exception but via the 'Out_of_ram' or 'Out_of_caps' types. Furthermore, the 'Parent::Service_denied', 'Parent::Unavailable', 'Root::Invalid_args', 'Root::Unavailable', 'Service::Invalid_args', 'Service::Unavailable', and 'Local_service::Factory::Denied' types have been replaced by the single 'Service_denied' exception type defined in 'session/session.h'. This consolidation eases the error handling (there are fewer exceptions to handle), alleviates the need to convert exceptions along the session-creation call chain, and avoids possible aliasing problems (catching the wrong type with the same name but living in a different scope).
This commit is contained in:
committed by
Christian Helmuth
parent
1f4f119b1e
commit
4d442bca30
@@ -130,11 +130,11 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
|
||||
{
|
||||
long msi = Arg_string::find_arg(args, "device_config_phys").long_value(0);
|
||||
if (msi)
|
||||
throw Root::Unavailable();
|
||||
throw Service_denied();
|
||||
|
||||
if (!irq_alloc || irq_alloc->alloc_addr(1, _irq_number).error()) {
|
||||
error("Unavailable IRQ ", _irq_number, " requested");
|
||||
throw Root::Unavailable();
|
||||
error("unavailable IRQ ", _irq_number, " requested");
|
||||
throw Service_denied();
|
||||
}
|
||||
|
||||
_irq_object.start();
|
||||
|
||||
Reference in New Issue
Block a user