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

Provide way for publishing errors and allowing clients to deserialize them #629

Open
dansanduleac opened this issue Nov 4, 2019 · 1 comment

Comments

@dansanduleac
Copy link
Contributor

What happened?

Currently, it's a pain for a service high-level-foo to propagate RemoteExceptions coming from another service low-level-foo to its own clients (they have to deserialize the RemoteException, then turn it into a ServiceException and throw that, otherwise RemoteExceptions always map to 500).

A big challenge here lies in having to manually pick out the right arguments by name from the RemoteException, with no error occurring if mistakes were made.

What did you want to happen?

Would be good for services that throw conjure exceptions to

  1. publish the arguments of those exceptions as a (conjure) object that has a clear structure
  2. provide a way to parse a RemoteException into a given error defined in the API that you consume

Then, the high-level-foo service maintainer can just attempt to convert the RemoteException into one or more "expected" exceptions, and handle each one in a type safe way.

This probably requires conjure-backcompat to enforce backcompat on the arguments defined for each error code, such that renaming an error would be an API break, and so would removing / renaming previously declared arguments of that error.

cc @jiahuijiang

@dansanduleac dansanduleac transferred this issue from palantir/conjure-java-runtime Nov 4, 2019
@chris05atm
Copy link

chris05atm commented Apr 1, 2020

This would be useful for an internal product codenamed SW and for a customer account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants