mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 07:38:28 +00:00
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
@ -77,8 +77,10 @@ Child::Process::Process(Dataspace_capability elf_ds,
|
||||
/* attach ELF locally */
|
||||
addr_t elf_addr;
|
||||
try { elf_addr = local_rm.attach(elf_ds); }
|
||||
catch (Region_map::Attach_failed) {
|
||||
error("local attach of ELF executable failed"); throw; }
|
||||
catch (Region_map::Invalid_dataspace) {
|
||||
error("local attach of ELF executable failed (Invalid_dataspace)"); throw; }
|
||||
catch (Region_map::Region_conflict) {
|
||||
error("local attach of ELF executable failed (Region_conflict)"); throw; }
|
||||
|
||||
/* setup ELF object and read program entry pointer */
|
||||
Elf_binary elf(elf_addr);
|
||||
|
@ -179,7 +179,7 @@ Region_map::Local_addr Region_map_mmap::attach(Dataspace_capability ds,
|
||||
/* only support attach_at for sub RM sessions */
|
||||
if (_sub_rm && !use_local_addr) {
|
||||
error("Region_map_mmap::attach: attaching w/o local addr not supported");
|
||||
throw Out_of_metadata();
|
||||
throw Region_conflict();
|
||||
}
|
||||
|
||||
if (offset < 0) {
|
||||
@ -261,7 +261,7 @@ Region_map::Local_addr Region_map_mmap::attach(Dataspace_capability ds,
|
||||
*/
|
||||
if (rm->_base) {
|
||||
error("Region_map_mmap::attach: mapping a sub RM session twice is not supported");
|
||||
throw Out_of_metadata();
|
||||
throw Region_conflict();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user