Skip to content

Commit f335e7c

Browse files
cursoragentCodex Agent
andcommitted
Restore defensive catch for session recovery race
Co-Authored-By: Codex Agent <agent-noreply@example.com>
1 parent 5674b15 commit f335e7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Sentry/GlobalSessionManager.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ private void DeletePersistedSession()
201201

202202
return sessionUpdate;
203203
}
204+
catch (Exception ex) when (ex is FileNotFoundException or DirectoryNotFoundException)
205+
{
206+
_options.LogDebug(ex, "A persisted session file was not found at '{0}'.", filePath);
207+
208+
return null;
209+
}
204210
catch (Exception ex)
205211
{
206212
_options.LogError(ex, "Failed to recover persisted session from the file system '{0}'.", filePath);

0 commit comments

Comments
 (0)