Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.21 KB

File metadata and controls

39 lines (28 loc) · 1.21 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