Translate buffer-exceeded exception in Session_requester

Session_requester inherits from Dynamic_rom_session::Content_producer
which specifies the Buffer_capacity_exceeded exception which is thrown
on insufficient buffer space.
This commit is contained in:
Christian Helmuth 2017-06-28 16:41:52 +02:00 committed by Norman Feske
parent c18dffa9fa
commit 78f1fd29f7

View File

@ -35,9 +35,13 @@ class Genode::Session_requester
void produce_content(char *dst, Genode::size_t dst_len) override
{
Xml_generator xml(dst, dst_len, "session_requests", [&] () {
_id_space.for_each<Session_state const>([&] (Session_state const &s) {
s.generate_session_request(xml); }); });
try {
Xml_generator xml(dst, dst_len, "session_requests", [&] () {
_id_space.for_each<Session_state const>([&] (Session_state const &s) {
s.generate_session_request(xml); }); });
} catch (Xml_generator::Buffer_exceeded &) {
throw Buffer_capacity_exceeded();
}
}
} _content_producer { _id_space };