RFC: smart server protocol change for 0.16

Robert Collins robertc at robertcollins.net
Wed Apr 11 10:58:05 BST 2007


One of the things I noticed while hacking on RemoteGraph was that error
handling really needs to be improved a little. After chatting with
Martin, we agreed that a nice improvement to the protocol would be that
all responses have a success/fail prefix.

That is, rather than using 'ok' for boolean results and 'resultX' for
non boolean, we'd return responses like:
'ok', 'True'
or
'ok', 'resultX'
for success, and
'error', 'ErrorClass', ...
for errors.

This would make it unambigous about whether a given result is an error
or not, and allow us to centralise the error handling as it would no
longer be per-verb.

If we do this consistently, its a API break - but I think its a
worthwhile one. We could add synonyms for all the current verbs which
return the older style reponses, but personally I dont think thats worth
it.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070411/d09fae74/attachment.pgp 


More information about the bazaar mailing list