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

Custom validator example does not work because of throw #33

Closed
haemi opened this issue Mar 21, 2022 · 2 comments
Closed

Custom validator example does not work because of throw #33

haemi opened this issue Mar 21, 2022 · 2 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@haemi
Copy link

haemi commented Mar 21, 2022

Hi,

I tried to implement a custom validator, based on the MyBadWSValidator example, but it doesn't compile because of the throw statements there, as the method itself does not have throws in the signature.

I don't know what's the intended solution for this; if throw is added in the signature, it affects the validate message within the HTTPClient...

@haemi
Copy link
Author

haemi commented Mar 21, 2022

maybe the solution is pretty easy: is it just that instead of throw we should use return .failChain(HTTPError(.invalidResponse))?

@malcommac
Copy link
Collaborator

yeah absolutely right, it's an error related to the old implementation. I've just fixed it.

@malcommac malcommac added bug Something isn't working documentation Improvements or additions to documentation labels Mar 21, 2022
@malcommac malcommac self-assigned this Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants