Closed williamspatrick closed 1 year ago
Hi, is there any workaround ? I have the same requirement, Regards, Francine
I think what I intended to do here is mostly done. There is now exception
, generated_exception
, internal_exception
and a number of sub-classes of these.
Can you elaborate on what your requirement is if it isn't already met?
Hi @williamspatrick ,
Thank you to help me, I am grateful !
I agree with you, it is working on dbus . But I can't figure out how to code it with async_method_call.
I simply throw an exception in my dbus service :
And I receive it on client side.
My service works with a pure dbus call:
But with bmcweb
, client side with an async_call_method, I recevie the error as a boost::system::error_code:
I cannot figure out what I should code ?
Should I use another async_method_call ? a one without boost::system::error_code
?
Should I cast my boost error_code (to what?) ?
How can I compare my thrown exception (inheriting sdbusplus::exception_t) with the received exception inasync callback ec
(typed as boost::system::error_code
) ?
I found a generated map_exception I tried to display message, value properties: wierd : category name is generic and value is 5.
I should have missed smth obvious, according to your anwser, it is sometimes difficult to imagine what is generated for our convenient :-).
What do you mean by internal_exception
and generated_exception
?
I may have an old sdbusplus version, it could explain why I do not understand....
PS: Sorry for my english, I am French, tell me if you don't understand my explanation, Best Regards, Francine
@williamspatrick I understood what you said. I patch with https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/21611/1/sdbusplus/asio/detail/async_send_handler.hpp#116
Thanks,
Right now method call exceptions turn into a generic sdbusplus
internal_exception
even though they are not internal. Switch up the class hierarchy and provide some handling so thatorg.freedesktop.dbus
exceptions become internal exceptions and other types become non-internal.