Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REGAPIC: which exception should be thrown if transcoding fails? #659

Closed
jskeet opened this issue Dec 7, 2022 · 1 comment · Fixed by #660, #633 or #664
Closed

REGAPIC: which exception should be thrown if transcoding fails? #659

jskeet opened this issue Dec 7, 2022 · 1 comment · Fixed by #660, #633 or #664
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@jskeet
Copy link
Collaborator

jskeet commented Dec 7, 2022

If a request is invalid in a way that makes transcoding fail (e.g. it's missing a required field, or that field's value is inappropriate) we currently throw an ArgumentException. If the request can be transcoded, but is otherwise invalid, the server will fail instead and we'll get an RpcException. Should we create an "artificial" RpcException instead in this case?

@jskeet jskeet self-assigned this Dec 7, 2022
@jskeet jskeet added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Dec 7, 2022
@amanda-tarafa
Copy link
Collaborator

+1 to creating an RpcException. That we need some fields to actually make the call is an implementation detail, from the caller point of view, the request is as invalid as one that reaches the server and fails there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
2 participants