Skip to content

Commit 6bd26c2

Browse files
Dependencies: annotate clang trace decoding errors with file paths
1 parent 3fb2393 commit 6bd26c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/SWBTaskExecution/TaskActions/ClangCompileTaskAction.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,11 @@ public final class ClangCompileTaskAction: TaskAction, BuildValueValidatingTaskA
491491
if traceFileContent.isEmpty {
492492
traceData = []
493493
} else {
494-
traceData = try JSONDecoder().decode(Array<TraceData>.self, from: Data(traceFileContent))
494+
do {
495+
traceData = try JSONDecoder().decode(Array<TraceData>.self, from: Data(traceFileContent))
496+
} catch {
497+
throw StubError.error("Failed to decode json trace at \(traceFilePath.str): \(error)")
498+
}
495499
}
496500

497501
var allFiles = Set<Path>()

0 commit comments

Comments
 (0)