File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -209,10 +209,21 @@ protocol SwiftCommand: ParsableCommand {
209
209
extension SwiftCommand {
210
210
public func run( ) throws {
211
211
let swiftTool = try SwiftTool ( options: globalOptions)
212
- try self . run ( swiftTool)
213
- swiftTool. waitForObservabilityEvents ( timeout: . now( ) + 5 ) // wait for all observability items to process
214
- if swiftTool. observabilityScope. errorsReported || swiftTool. executionStatus == . failure {
215
- throw ExitCode . failure
212
+ var toolError : Error ? = . none
213
+ do {
214
+ try self . run ( swiftTool)
215
+ if swiftTool. observabilityScope. errorsReported || swiftTool. executionStatus == . failure {
216
+ throw ExitCode . failure
217
+ }
218
+ } catch {
219
+ toolError = error
220
+ }
221
+
222
+ // wait for all observability items to process
223
+ swiftTool. waitForObservabilityEvents ( timeout: . now( ) + 5 )
224
+
225
+ if let error = toolError {
226
+ throw error
216
227
}
217
228
}
218
229
You can’t perform that action at this time.
0 commit comments