[best practice][.srv] Mandatory return type?

I would definitely not recommend string as a return type. That would require you to be doing string comparisons and be highly fragile.

A return code with an error description or message that’s filled if there’s an error might make sense. However again the description shouldn’t have anything happen to it but display it.

The response should be designed to encode whatever information is necessary for the client to respond appropriately. I don’t think that it would be valuable to try to necessarily enforce a uniform response recommendation. If you discover those sorts of shortcomings my recommendation is to extend the message. This process of learning while using is why we want non-trivial implementations and usage for messages before standardizing them so that we can catch these sorts of oversights.

1 Like