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

Enable deserialization of ErrorResponse subtypes #32

Open
romanstrobl opened this issue Mar 16, 2021 · 1 comment
Open

Enable deserialization of ErrorResponse subtypes #32

romanstrobl opened this issue Mar 16, 2021 · 1 comment
Assignees

Comments

@romanstrobl
Copy link
Member

The DefaultRestClient can currently deserialize only the ErrorResponse type, but it fails to deserialize subtypes of the ErrorResponse. We should introduce a configuration option which allows to map error codes to types dynamically and allow to deserialize custom error responses which usually contain additional error data such as validation errors.

@romanstrobl
Copy link
Member Author

The use case of custom error handling can be handled in the client code, see:
https://github.com/wultra/powerauth-webflow/blob/3c0a09da6a6f02ea1ade00c37c8b85625c85d460/powerauth-nextstep-client/src/main/java/io/getlime/security/powerauth/lib/nextstep/client/NextStepClientException.java#L131

Although this solution is far from ideal when considering the code style, technically it work fine, so we can postpone this issue to the next release.

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

No branches or pull requests

1 participant