Skip to content

Commit ffe0649

Browse files
authored
fix(tests): Remove fatal error logging in SentryFileManager (#7177)
This change prevents fatal error logs from cluttering test outputs when the Sentry SDK working directory or envelopes directory cannot be created during tests. The logging is conditionally compiled to exclude test environments.
1 parent a7d7fb6 commit ffe0649

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/Sentry/SentryFileManagerHelper.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,18 @@ - (nullable instancetype)initWithOptions:(SentryOptions *_Nullable)options error
120120
[self removeFileAtPath:self.eventsPath];
121121

122122
if (!createDirectoryIfNotExists(self.sentryPath, error)) {
123+
// Disabled fatal error logging in tests to reduce noise in test logs
124+
#if !SENTRY_TEST && !SENTRY_TEST_CI
123125
SENTRY_LOG_FATAL(@"Failed to create Sentry SDK working directory: %@", self.sentryPath);
126+
#endif
124127
return nil;
125128
}
126129
if (!createDirectoryIfNotExists(self.envelopesPath, error)) {
130+
// Disabled fatal error logging in tests to reduce noise in test logs
131+
#if !SENTRY_TEST && !SENTRY_TEST_CI
127132
SENTRY_LOG_FATAL(
128133
@"Failed to create Sentry SDK envelopes directory: %@", self.envelopesPath);
134+
#endif
129135
return nil;
130136
}
131137

0 commit comments

Comments
 (0)