[Maintainers] Call for maintenance

Lei YU mine260309 at gmail.com
Wed Aug 1 12:13:40 AEST 2018


On Tue, Jul 31, 2018 at 10:21 PM Tom Joseph <tomjose at linux.vnet.ibm.com> wrote:
>
> Hello,
>
> I am scrubbing the phosphor-host-ipmid to handle the SdBusError exception.
>
> Even though sdbusplus::exception::SdBusError is inherited from
> std::exception,
> my observation is that catch statement of std::exception does not catch
> sdbusplus::exception::SdBusError exception.
>
> try
> {
>      // Statement throwing sdbusplus::exception::SdBusError exception.
> }
> catch (const std::exception& e) // Does not catch
> sdbusplus::exception::SdBusError
> {
>
> }
>
> I think the multiple inheritance from std::exception is causing this.
>

Yup, I meet the same issue.
The root cause is multiple inheritance of std::exception:

    struct exception : public std::exception;
    struct internal_exception : public exception;
    class SdBusError final : public internal_exception, public
std::system_error;

SdBusError inherits both internal_exception and std::system_error,
which both inherit std::exception.
We can not use virtual inheritance here because std::system_error
already non-virtually inherits std::exception.

So probably we should not use diamond inheritance here...


More information about the openbmc mailing list