Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/catch_session.cpp
diff options
context:
space:
mode:
authorLeitwolf2026-10-11 10:09:19 +0300
committerGitHub2026-10-11 10:09:19 +0300
commitce6fa1996a8e358efdcff53a7628584077d9855c (patch)
treed76f5945311828511e3ea55712487f21fbf8f70f /src/catch2/catch_session.cpp
parent5633c5c98ec073ae938253bcfc72430d5d9aee89 (diff)
parent1f78d8903c2fb18afea8c3055f8df83d8c60d9b5 (diff)
downloadcatch3-ce6fa1996a8e358efdcff53a7628584077d9855c.tar.gz
Merge pull request #4 from Progmasoft/backport/upstream-3.16.1
Backport Catch2 3.16.1
Diffstat (limited to 'src/catch2/catch_session.cpp')
-rw-r--r--src/catch2/catch_session.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp
index 1c993ce1..34fd2809 100644
--- a/src/catch2/catch_session.cpp
+++ b/src/catch2/catch_session.cpp
@@ -458,7 +458,17 @@ namespace Catch {
getCurrentMutableContext().setConfig(m_config.get());
// Create reporter(s) so we can route listings through them
- auto reporter = prepareReporters(m_config.get());
+ IEventListenerPtr reporter;
+ CATCH_TRY {
+ auto reporter_ = prepareReporters( m_config.get() );
+ swap( reporter, reporter_ );
+ }
+#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
+ catch ( std::exception& ex ) {
+ Catch::cerr() << "Error when creating reporter: " << ex.what() << '\n' << std::flush;
+ return ReporterConstructionErrorExitCode;
+ }
+#endif
auto const& invalidSpecs = m_config->testSpec().getInvalidSpecs();
if ( !invalidSpecs.empty() ) {