base: move common exception types to exception.h

The univerally used exception types Out_of_ram, Out_of_caps, and Denied
used to be defined at quota_guard.h and ram_allocator.h whereas the
types are broadly used. This patch gathers those type definitions at
the central place exception.h instead, to gradually untangle the reliance
on exceptions, i.e., in quota_goard.h, and to make the output of error
messages printing exception types ('abort') more concise.

Issue #5245
This commit is contained in:
Norman Feske
2025-04-05 13:27:05 +02:00
parent 7e0d2084fb
commit 2e76f4fc58
6 changed files with 27 additions and 26 deletions

View File

@ -14,6 +14,7 @@
#ifndef _INCLUDE__SESSION__SESSION_H_
#define _INCLUDE__SESSION__SESSION_H_
#include <base/exception.h>
#include <base/quota_guard.h>
#include <base/session_label.h>
#include <util/arg_string.h>
@ -34,7 +35,7 @@ namespace Genode {
*/
struct Insufficient_ram_quota : Exception { };
struct Insufficient_cap_quota : Exception { };
struct Service_denied : Exception { };
using Service_denied = Denied;
}