Skip to content

Commit a6f2534

Browse files
committed
Remove unused AppError.invalidPackageUrl
1 parent bf80f66 commit a6f2534

File tree

4 files changed

+2
-9
lines changed

4 files changed

+2
-9
lines changed

Sources/App/Commands/Common.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ func recordError(database: Database,
121121
try await setStatus(id: id, status: .invalidCachePath)
122122
case let .cacheDirectoryDoesNotExist(id, _):
123123
try await setStatus(id: id, status: .cacheDirectoryDoesNotExist)
124-
case let .invalidPackageUrl(id, _):
125-
try await setStatus(id: id, status: .invalidUrl)
126124
case let .invalidRevision(id, _):
127125
try await setStatus(id: id, status: .analysisFailed)
128126
case let .metadataRequestFailed(id, _, _):

Sources/App/Core/AppError.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import Vapor
1818
enum AppError: LocalizedError {
1919
case analysisError(Package.Id?, _ message: String)
2020
case envVariableNotSet(_ variable: String)
21-
case invalidPackageUrl(Package.Id?, _ url: String)
2221
case invalidPackageCachePath(Package.Id?, _ path: String)
2322
case cacheDirectoryDoesNotExist(Package.Id?, _ path: String)
2423
case invalidRevision(Version.Id?, _ revision: String?)
@@ -34,8 +33,6 @@ enum AppError: LocalizedError {
3433
return "Analysis failed: \(message) (id: \(id))"
3534
case let .envVariableNotSet(value):
3635
return "Environment variable not set: \(value)"
37-
case let .invalidPackageUrl(id, value):
38-
return "Invalid packge URL: \(value) (id: \(id))"
3936
case let .invalidPackageCachePath(id, value):
4037
return "Invalid packge cache path: \(value) (id: \(id))"
4138
case let .cacheDirectoryDoesNotExist(id, value):

Tests/AppTests/ErrorReportingTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class ErrorReportingTests: AppTestCase {
2222
func test_recordError() async throws {
2323
let pkg = try await savePackageAsync(on: app.db, "1")
2424
try await recordError(database: app.db,
25-
error: AppError.invalidPackageUrl(pkg.id, "foo"),
25+
error: AppError.cacheDirectoryDoesNotExist(pkg.id, "path"),
2626
stage: .ingestion)
2727
do {
2828
let pkg = try fetch(id: pkg.id, on: app.db)
29-
XCTAssertEqual(pkg.status, .invalidUrl)
29+
XCTAssertEqual(pkg.status, .cacheDirectoryDoesNotExist)
3030
XCTAssertEqual(pkg.processingStage, .ingestion)
3131
}
3232
}

Tests/AppTests/Util+ext.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ extension App.AppError: Swift.Equatable {
9494
return (id1, v1) == (id2, v2)
9595
case let (.invalidPackageCachePath(id1, v1), .invalidPackageCachePath(id2, v2)):
9696
return (id1, v1) == (id2, v2)
97-
case let (.invalidPackageUrl(id1, v1), .invalidPackageUrl(id2, v2)):
98-
return (id1, v1) == (id2, v2)
9997
case let (.invalidRevision(id1, v1), .invalidRevision(id2, v2)):
10098
return (id1, v1) == (id2, v2)
10199
case let (.metadataRequestFailed(id1, s1, u1), .metadataRequestFailed(id2, s2, u2)):

0 commit comments

Comments
 (0)