Skip to content

Commit 96d37e2

Browse files
authored
Fix multi-sentence error messages (#443)
Fixes multi-sentence error messages, where they start from a lowercased letter.
1 parent e8aff29 commit 96d37e2

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Sources/Containerization/Image/ImageStore/ImageStore+Import.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ extension ImageStore {
209209
throw ContainerizationError(
210210
.internalError,
211211
message:
212-
"descriptor \(root.mediaType) with digest \(root.digest) does not list any supported platform or supports more than one platform. Supported platforms = \(supportedPlatforms)"
212+
"descriptor \(root.mediaType) with digest \(root.digest) does not list any supported platform or supports more than one platform, supported platforms: \(supportedPlatforms)"
213213
)
214214
}
215215
let platform = supportedPlatforms.first!

Sources/Containerization/Image/ImageStore/ImageStore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ extension ImageStore {
208208
do {
209209
_ = try Reference.parse(new)
210210
} catch {
211-
throw ContainerizationError(.invalidArgument, message: "invalid reference \(new). Error: \(error)")
211+
throw ContainerizationError(.invalidArgument, message: "invalid reference \(new), error: \(error)")
212212
}
213213
let newDescription = Image.Description(reference: new, descriptor: descriptor)
214214
return try await self.create(description: newDescription)

Sources/ContainerizationArchive/ArchiveError.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ public enum ArchiveError: Error, CustomStringConvertible {
5555
case .unableToAddFilter(let code, let name):
5656
return "unable to set the archive filter \(name), code \(code)"
5757
case .unableToWriteEntryHeader(let code):
58-
return "unable to write the entry header to the archive. Error code \(code)"
58+
return "unable to write the entry header to the archive, code \(code)"
5959
case .unableToWriteData(let code):
60-
return "unable to write data to the archive. Error code \(code)"
60+
return "unable to write data to the archive, code \(code)"
6161
case .unableToCloseArchive(let code):
62-
return "unable to close the archive. Error code \(code)"
62+
return "unable to close the archive, code \(code)"
6363
case .unableToOpenArchive(let code):
64-
return "unable to open the archive. Error code \(code)"
64+
return "unable to open the archive, code \(code)"
6565
case .unableToSetOption(_):
6666
return "unable to set an option on the archive."
6767
case .failedToSetLocale(let locales):

Sources/ContainerizationOCI/Client/LocalOCILayoutClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ package final class LocalOCILayoutClient: ContentClient {
8787
throw ContainerizationError(
8888
.internalError,
8989
message:
90-
"file \(filePath) exists but contains different content. expected digest: \(expectedDigest.digestString), existing digest: \(existingDigest.digestString)"
90+
"file \(filePath) exists but contains different content, expected digest: \(expectedDigest.digestString), existing digest: \(existingDigest.digestString)"
9191
)
9292
}
9393

Sources/ContainerizationOCI/Content/ContentWriter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class ContentWriter {
3636
let exists = FileManager.default.fileExists(atPath: base.path, isDirectory: &isDirectory)
3737

3838
guard exists && isDirectory.boolValue else {
39-
throw ContainerizationError(.internalError, message: "cannot create ContentWriter for path \(base.absolutePath()). Not a directory")
39+
throw ContainerizationError(.internalError, message: "cannot create ContentWriter for path \(base.absolutePath()), not a directory")
4040
}
4141
}
4242

Sources/ContainerizationOCI/Reference.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public class Reference: CustomStringConvertible {
188188
tag = fields["tag"] ?? ""
189189

190190
if tag.isEmpty {
191-
throw ContainerizationError(.invalidArgument, message: "invalid format for image reference. Missing tag")
191+
throw ContainerizationError(.invalidArgument, message: "invalid format for image reference, missing tag")
192192
}
193193
return try Reference(path: self.path, domain: self.domain, tag: tag)
194194
}
@@ -202,7 +202,7 @@ public class Reference: CustomStringConvertible {
202202
digest = fields["digest"] ?? ""
203203

204204
if digest.isEmpty {
205-
throw ContainerizationError(.invalidArgument, message: "invalid format for image reference. Missing digest")
205+
throw ContainerizationError(.invalidArgument, message: "invalid format for image reference, missing digest")
206206
}
207207
return try Reference(path: self.path, domain: self.domain, digest: digest)
208208
}

0 commit comments

Comments
 (0)