Skip to content

Commit 0b4ccd6

Browse files
Remove KafkaError.ErrorCode.acknowledgement (#101)
Motivation: Error type was unused and should not clutter public API. Modifications: * remove `KafkaError.ErrorCode.acknowledgement` and all related code * minor fix: throw `KafkaError.topicConfig` instead of `KafkaError.config` in `KakfaTopicConfiguration`
1 parent 12020f5 commit 0b4ccd6

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

Sources/SwiftKafka/KafkaError.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ public struct KafkaError: Error, CustomStringConvertible {
6464
)
6565
}
6666

67-
static func acknowledgement(
68-
reason: String, file: String = #fileID, line: UInt = #line
69-
) -> KafkaError {
70-
return KafkaError(
71-
backing: .init(
72-
code: .acknowledgement, reason: reason, file: file, line: line
73-
)
74-
)
75-
}
76-
7767
static func config(
7868
reason: String, file: String = #fileID, line: UInt = #line
7969
) -> KafkaError {
@@ -154,7 +144,6 @@ extension KafkaError {
154144
public struct ErrorCode: Hashable, Sendable, CustomStringConvertible {
155145
fileprivate enum BackingCode {
156146
case rdKafkaError
157-
case acknowledgement
158147
case config
159148
case topicConfig
160149
case connectionClosed
@@ -172,8 +161,6 @@ extension KafkaError {
172161

173162
/// Errors caused by the underlying `librdkafka` library.
174163
public static let rdKafkaError = ErrorCode(.rdKafkaError)
175-
/// A ``KafkaProducerMessage`` could not be acknowledged by the Kafka server.
176-
public static let acknowledgement = ErrorCode(.acknowledgement)
177164
/// There is an error in the Kafka client configuration.
178165
public static let config = ErrorCode(.config)
179166
/// There is an error in the Kafka topic configuration.

Sources/SwiftKafka/RDKafka/RDKafkaTopicConfig.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct RDKafkaTopicConfig {
4848

4949
if configResult != RD_KAFKA_CONF_OK {
5050
let errorString = String(cString: errorChars)
51-
throw KafkaError.config(reason: errorString)
51+
throw KafkaError.topicConfig(reason: errorString)
5252
}
5353
}
5454
}

0 commit comments

Comments
 (0)