From 132f8d67a0599e22065960d927bb1b93403a8b61 Mon Sep 17 00:00:00 2001 From: "Sven A. Schmidt" Date: Mon, 25 Sep 2023 05:43:18 +0200 Subject: [PATCH] Log updatePackage errors (and don't abort) --- Sources/App/Commands/Common.swift | 6 +++++- Tests/AppTests/AnalyzerTests.swift | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/App/Commands/Common.swift b/Sources/App/Commands/Common.swift index 0b0addd1e..7a9d3ec96 100644 --- a/Sources/App/Commands/Common.swift +++ b/Sources/App/Commands/Common.swift @@ -43,7 +43,11 @@ func updatePackages(client: Client, } } for result in results { - try await updatePackage(client: client, database: database, logger: logger, result: result, stage: stage) + do { + try await updatePackage(client: client, database: database, logger: logger, result: result, stage: stage) + } catch { + logger.critical("updatePackage failed: \(error)") + } } logger.debug("updateStatus ops: \(results.count)") diff --git a/Tests/AppTests/AnalyzerTests.swift b/Tests/AppTests/AnalyzerTests.swift index c96ac13e2..eea305725 100644 --- a/Tests/AppTests/AnalyzerTests.swift +++ b/Tests/AppTests/AnalyzerTests.swift @@ -788,7 +788,7 @@ class AnalyzerTests: AppTestCase { XCTAssertEqual(targets.map(\.type), [.regular, .executable]) } - func test_updatePackage() async throws { + func test_updatePackages() async throws { // setup let packages = try savePackages(on: app.db, ["1", "2"].asURLs) .map(Joined.init(model:))