Ticket #5667 enhancement new
Opened 22 months ago
Document how IArgument.fromStringProto should signal failures
|Reported by:||exarkun||Owned by:|
If an argument value cannot be converted to a structured object (for example, the string "hello" being received for an Integer argument), fromStringProto must presumably fail. It would be nice if the way in which it is supposed to fail were documented (it's possible this is just "raise any exception", which seems to be the current reality).
Additionally, it would be nice if argument decoding errors weren't necessarily fatal. If an IArgument implementation can somehow signal it is safe to do so, then it might be preferable to let the connection survive and send back an error indicating the argument could not be parsed. Care should be taken here: it may still be necessary to parse all argument values, even if a random argument in the middle raises an exception). Since signaling this fallback is possible might have interface implications, it might make sense to do this at the same time (as updating IArgument documentation) or first.