Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.37 KB

Utilities.md

File metadata and controls

38 lines (28 loc) · 1.37 KB

Utilities

Contents

ExceptionCollector

ExceptionCollector is a utility that allows you to have multiple exceptions thrown, without stopping the execution of the program, and then throw them all later.

ExceptionCollector exceptions;
for (int i = 1; i <= 4; ++i)
{
    exceptions.gather([&]() { /* Code that may throw errors here */ });
}
exceptions.release(); // All errors actually thrown together here

snippet source | anchor

Use with Approval Tests: See Approving multiple files in one test.


Back to User Guide