aboutsummaryrefslogtreecommitdiff
path: root/src/protobuf/wkt/any_pb.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/protobuf/wkt/any_pb.nim')
-rw-r--r--src/protobuf/wkt/any_pb.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/protobuf/wkt/any_pb.nim b/src/protobuf/wkt/any_pb.nim
index 6a65b66..f7ef421 100644
--- a/src/protobuf/wkt/any_pb.nim
+++ b/src/protobuf/wkt/any_pb.nim
@@ -84,9 +84,13 @@ proc readgoogle_protobuf_Any*(stream: ProtobufStream): google_protobuf_Any =
tag = readTag(stream)
wireType = getTagWireType(tag)
case getTagFieldNumber(tag)
+ of 0:
+ raise newException(InvalidFieldNumberError, "Invalid field number: 0")
of 1:
+ expectWireType(wireType, WireType.LengthDelimited)
settype_url(result, readString(stream))
of 2:
+ expectWireType(wireType, WireType.LengthDelimited)
setvalue(result, readBytes(stream))
else: skipField(stream, wireType)