Skip to content

Commit 84b0dc0

Browse files
committed
Update comment about why unexpected errors and turned into diagnostics and add FIXME to change this in the future
1 parent 0d28c07 commit 84b0dc0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/SwiftDocC/Infrastructure/ConvertActionConverter.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ package enum ConvertActionConverter {
6969

7070
// An inner function to gather problems for errors encountered during the conversion.
7171
//
72-
// These problems only represent unexpected thrown errors and aren't particularly user-facing but because
73-
// `DocumentationConverter.convert(outputConsumer:)` emits them as diagnostics we do the same here.
72+
// These problems only represent unexpected thrown errors and aren't particularly user-facing.
73+
// For now we emit them as diagnostics because `DocumentationConverter.convert(outputConsumer:)` (which this replaced) used to do that.
74+
//
75+
// FIXME: In the future we could simplify this control flow by not catching these errors and turning them into diagnostics.
76+
// Since both error-level diagnostics and thrown errors fail the documentation build,
77+
// the only practical different this would have is that we stop on the first unexpected error instead of processing all pages and gathering all unexpected errors.
7478
func recordProblem(from error: Swift.Error, in problems: inout [Problem], withIdentifier identifier: String) {
7579
let problem = Problem(diagnostic: Diagnostic(
7680
severity: .error,

0 commit comments

Comments
 (0)