Page MenuHomePhabricator

test: don't throw from the destructor of DebugLogHelper
ClosedPublic

Authored by Fabien on Wed, Nov 5, 22:13.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCf6f59226778d: test: don't throw from the destructor of DebugLogHelper
Summary
Throwing an exception from the destructor of a class is a bad practice because the destructor will be called when an object of that type is alive on the stack and another exception is thrown, which will result in "exception during the exception". This would terminate the program without any messages.

Instead print the message to the standard error output and call std::abort().

Backport of core#33388.

Depends on D18886.

Test Plan
ninja all check-all