-
Type: Story
-
Status: Resolved (View Workflow)
-
Priority: Medium
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: VOLTHA v2.1
-
Component/s: api-server
-
Labels:
-
Story Points:1
-
Epic Link:
In affinity router unit test,
s, err = aRouter.decodeProtoField(portData, 5) // field 5 is AdminState
Will cause a panic if the admin_state field was not set:
{"level":"debug","ts":"2019-09-23T10:35:07.812-0700","msg":"Decoding afinity value attributeNumber: 5 from [8 123 18 9 116 101 115 116 108 97 98 101 108 24 3 58 4 53 54 55 56 73 148 38 0 0 0 0 0 0] at index 30","caller":"affinity-router.decodeProtoField:233"} --- FAIL: TestAffinityRouterDecodeProtoField (0.02s) panic: runtime error: index out of range [recovered] panic: runtime error: index out of range
Return a suitable error instead.
# | Subject | Branch | Project | Status | CR | V |
---|---|---|---|---|---|---|
15868,2 | VOL-1952 return error if message has missing field | master | voltha-api-server | Status: MERGED | +2 | +1 |