From 9582361341e7438d437bf26a6d58bdd01a76a474 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Tue, 20 Oct 2026 14:17:12 +0200 Subject: [PATCH 1/2] Swift: Do not terminate the extractor when a file cannot be opened --- swift/extractor/infra/file/TargetFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/extractor/infra/file/TargetFile.cpp b/swift/extractor/infra/file/TargetFile.cpp index 4ce4c8ae23be..cc00448eacdc 100644 --- a/swift/extractor/infra/file/TargetFile.cpp +++ b/swift/extractor/infra/file/TargetFile.cpp @@ -50,7 +50,7 @@ bool TargetFile::init() { checkOutput("open"); return true; } - CODEQL_ASSERT(errno == EEXIST, "Unable to open {} for writing ({})", targetPath, + CODEQL_EXPECT(errno == EEXIST, "Unable to open {} for writing ({})", targetPath, currentErrorCode()); // else the file already exists and we just lost the race return false; From a13a814b862ffba89e122c93e99925f221038e38 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Wed, 21 Oct 2026 10:21:37 +0200 Subject: [PATCH 2/2] Swift: Update comment --- swift/extractor/infra/file/TargetFile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swift/extractor/infra/file/TargetFile.cpp b/swift/extractor/infra/file/TargetFile.cpp index cc00448eacdc..84e6d44ec376 100644 --- a/swift/extractor/infra/file/TargetFile.cpp +++ b/swift/extractor/infra/file/TargetFile.cpp @@ -52,7 +52,8 @@ bool TargetFile::init() { } CODEQL_EXPECT(errno == EEXIST, "Unable to open {} for writing ({})", targetPath, currentErrorCode()); - // else the file already exists and we just lost the race + // else the file already exists and we just lost the race, or some error occurred + // and the file could not be created return false; }