-
Notifications
You must be signed in to change notification settings - Fork 51
Throw an error while reading unset values. #303
Throw an error while reading unset values. #303
Conversation
Signed-off-by: nayakned <naresh.nayak@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Signed-off-by: Sebastian Schildt <sebastian.schildt@de.bosch.com>
Tested with websocket and GRPC. Seems to work fine. |
Hmm wrt to 404 it seems VISS suggests it https://www.w3.org/TR/viss2-transport/#status-codes maybe we should get more standard compliant (yeah I know, our other error msgs are not, good way to strart :) ) so current PR does
according to spec we should do
The spec demands "message" as "The requested data was not found." , but I suggest not following that, because ours is more expressive. But number and reason |
…setting them. Signed-off-by: nayakned <naresh.nayak@de.bosch.com>
@SebastianSchildt This exception will also be thrown when a entire branch is being read, and even if one of the leaves has not been previously set. E.g. getValue on Vehicle.OBD.* will throw this error as soon as it encounters the first datapoint that hasnt been set. Would that be ok? |
…nts. Signed-off-by: nayakned <naresh.nayak@de.bosch.com>
Guess that is ok. We never promised anything regarding that behaviour (it seems to be one of this "atomic or not" discussions. Most common usecase is querying single values, and if you DO query a branch, most likely it is required/expected to get all subelements to be useful at all (e.g. GPS position), so I think it is toally acceptable to bail out if not all of the requested data can be provided. |
Checked WS and GRPC, works. Will merge & squash as you suggested |
getValue on values not explicitly set should throw an error.
This should implement #297