Exception constraints can be used to verify that your code throws the correct exceptions.
AssertThrows succeeds if the exception thrown by the call is of the supplied type (or one of its subtypes).
Making Assertions on the Thrown Exceptions
If AssertThrows succeeds, it will store the thrown exception so that you can make more detailed assertions on it.
Assert::That(LastException<std::logic_error>().what(), Is().Containing("logic failure"));
LastException<> is available in the scope of the call to
AssertThrows. An exception is not available between specs in order to avoid the result of one spec contaminating another.