google / google/googletest

the way (nested) exceptions are printed

Open
#2,186 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

Hi there,

`HandleExceptionsInMethodIfSupported` only prints the last thrown exception `e.what()` (formatted in `FormatCxxExceptionMessage`).

If the exception was nested (*i.e.* thrown with `std::throw_with_nested`) it would be great to unwrap and print all nested exceptions to get a useful message (using `std::rethrow_if_nested` like presented in https://en.cppreference.com/w/cpp/error/throw_with_nested).

Otherwise it would be great to be able to override `HandleExceptionsInMethodIfSupported` :D

Contributor guide

Open the contributing guide

Research direction

Locate HandleExceptionsInMethodIfSupported and FormatCxxExceptionMessage, then read how exceptions are currently caught and formatted. Compare the behavior with std::throw_with_nested and std::rethrow_if_nested as described in the linked reference. Done means nested exception details are reported, or the handler can be overridden if that alternative is selected, with corresponding tests for the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.