[Maintainers] Call for maintenance

Tom Joseph tomjose at linux.vnet.ibm.com
Wed Aug 1 00:19:41 AEST 2018


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.

Regards,
Tom

On Thursday 12 July 2018 11:22 PM, Brad Bishop wrote:
> I wanted to highlight a recent sdbusplus patch:
>
> https://gerrit.openbmc-project.xyz/#/c/10566/
>
> The nutshell is proper error handling of errors from libsystemd's
> sd_bus_call has been added and sdbusplus::bus::call may now throw
> SdBusError.
>
> This note is an open call to all maintainers to scrub your applications
> for use of sdbusplus::bus::call and handle SdBusError as appropriate.
>
> I want to point out that catching SdBusError in your wrapper function
> around sdbusplus::bus::call and simply eating it (or logging it, tracing
> it, etc) is not really “handling” this new exception.  Nor is wrapping
> your entire program in a try block “handling” it either.  Instead,
> traverse the stack until you find the code with the logic that knows
> whether or not the error is anticipated or not, and handle it there.
>
> For example:
>
> https://gerrit.openbmc-project.xyz/#/c/11423/3/src/propertywatchimpl.hpp
>
> thx - brad



More information about the openbmc mailing list