Skip to content

Commit 8f64727

Browse files
authored
[Bugfix] Finalize diagnostics even when an error is thrown (#187)
1 parent ed61e74 commit 8f64727

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/swift-openapi-generator/GenerateOptions+runGenerator.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,15 @@ extension _GenerateOptions {
7878
isDryRun: isDryRun,
7979
diagnostics: diagnostics
8080
)
81+
try finalizeDiagnostics()
8182
} catch let error as Diagnostic {
8283
// Emit our nice Diagnostics message instead of relying on ArgumentParser output.
8384
diagnostics.emit(error)
85+
try finalizeDiagnostics()
8486
throw ExitCode.failure
87+
} catch {
88+
try finalizeDiagnostics()
89+
throw error
8590
}
86-
try finalizeDiagnostics()
8791
}
8892
}

0 commit comments

Comments
 (0)