error codes and asserts have different purposes.
error codes and asserts have different purposes.
Posted Mar 22, 2019 0:40 UTC (Fri) by mcortese (guest, #52099)In reply to: error codes and asserts have different purposes. by john.carter
Parent article: GMP and assert()
Ideally I'd like the application to degrade in a localized and controlled way. For example, if the battery applet on my panel, which calculates the % of charge dividing the current charge by the max capacity, faces a divide-by-zero for whatever reason (say, a hardware failure of the battery control), it could simply show 0% or 100% or even a meaningless value, and yet this would be ways better than killing the whole panel[1].
So yes, sometimes wombling on doing stupider and stupider things is the desirable approach.
[1] In fact, this is not a made-up example but a real case with LXDE panel.
