Skip to content
← All tracks

Errors

C++

Failure as part of the type. The three honest answers to "this can go wrong" — return it, throw it, or refuse to continue — and how to tell which one you are looking at.

This track is written for C++, which isn't the mode you're browsing in.

0 / 4 solved
  1. 1. Not solved yet. Zero is an answer
  2. 2. Not solved yet. The catch that threw half of it away
  3. 3. Not solved yet. The promise the standard library reads
  4. 4. Not solved yet. The handler that hid the failure

Check yourself

4 questions · one attempt each

These do not count toward finishing the track. They are here to catch the things that are easy to read past.

0 / 4

An exception is thrown while guard is alive. When does ~Noisy run?

try {
    Noisy guard{"guard"};
    throw std::runtime_error("boom");
} catch (const std::exception& e) {
    // ...
}
Question 1 of 4