Skip to content

Commit 2ea9033

Browse files
author
Pouya Yarandi
committed
Rename error to proto applying
1 parent e286c26 commit 2ea9033

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/SwiftProtobuf/ProtobufMirror.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public extension ProtobufMirror {
133133

134134
}
135135

136-
public enum MessageModificationError: Error {
136+
public enum ProtoApplyingError: Error {
137137
case typeMismatch
138138
case invalidFieldNumber
139139
}

Sources/protoc-gen-swift/MessageGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ class MessageGenerator {
417417
p.print("""
418418
func valueAs<T>(_ type: T.Type) throws -> T {
419419
guard let _value = value as? T else {
420-
throw \(namer.swiftProtobufModulePrefix)MessageModificationError.typeMismatch
420+
throw \(namer.swiftProtobufModulePrefix)ProtoApplyingError.typeMismatch
421421
}
422422
return _value
423423
}
@@ -427,7 +427,7 @@ class MessageGenerator {
427427
for f in fields {
428428
f.generateApplying(printer: &p)
429429
}
430-
p.print("default: throw \(namer.swiftProtobufModulePrefix)MessageModificationError.invalidFieldNumber")
430+
p.print("default: throw \(namer.swiftProtobufModulePrefix)ProtoApplyingError.invalidFieldNumber")
431431
p.print("}")
432432
p.print("return copy")
433433
}

0 commit comments

Comments
 (0)