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 error evaluation #170

Open
adam8810 opened this issue Feb 5, 2018 · 2 comments
Open

Custom error evaluation #170

adam8810 opened this issue Feb 5, 2018 · 2 comments

Comments

@adam8810
Copy link

adam8810 commented Feb 5, 2018

The api I'm working with always returns an HTTP 200 whether an error has occurred or not. There is a status key that will either be "success" or "error" so what I'm looking for is a way to define how this middleware determines which action to dispatch when it receives a response based on something within the response object.

I was wondering if this is possible in the current implementation and if not how open you'd be to receive a PR for this functionality if it seems useful to others.

@nason
Copy link
Collaborator

nason commented Feb 6, 2018

Hi @adam8810, that would be a welcome addition indeed.

This is not possible today and we'd need to be able to provide a way for users to pass in their 'ok' condition here:

A PR would be most welcome -- let me know if there's any way I can help!

@iamandrewluca
Copy link
Collaborator

I made a PR that allow this. And also for future we can add more options that user can set

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

Successfully merging a pull request may close this issue.

3 participants