Fatal warnings in client code

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Mon Mar 6 20:54:32 UTC 2023


On Mon, 06 Mar 2023 21:35:13 +0100, René J.V. Bertin wrote:

> I agree with the OP that this is not recommendable behaviour for a
> library. If you can cause a deliberate crash you can also almost
> always also return an error that allows the calling code to handle
> the situation gracefully (and correct the bug).

By definition, if the client code is not using the library correctly,
it’s not in a position to “correct the bug”. In this situation, it
makes sense to crash the app, while giving as much information as
practicable to help the programmer diagnose and fix the problem.

> In an ideal world the devs of the calling code would catch all those
> bugs and the resulting crashes but in practice they'll only catch the
> most obvious ones. The remaining ones will all be in the face of
> users who just happen to play the role of fool proofer...

The obvious response to the user who reports the bug is “send us [the
relevant part of] your ~/.xsession-errors file”. That’s why we have
diagnostic output, after all ...


More information about the dbus mailing list