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

Incorrect response type for responseMiddleware #428

Closed
aaronadamsCA opened this issue Jan 24, 2023 · 2 comments · Fixed by #534
Closed

Incorrect response type for responseMiddleware #428

aaronadamsCA opened this issue Jan 24, 2023 · 2 comments · Fixed by #534

Comments

@aaronadamsCA
Copy link

aaronadamsCA commented Jan 24, 2023

The interface for responseMiddleware says my middleware function should receive response: Response<unknown> | Error, but my middleware function looks like it's actually receiving ClientError:

console.log(JSON.stringify(response));
{
  "response": {
    "error": "",
    "status": 401,
    "headers": {}
  },
  "request": {
    "query": "..."
  }
}

I think the type should be expanded to Response<unknown> | ClientError | Error.

@kevindurb
Copy link

Yea i see this too

@rickvian
Copy link
Contributor

rickvian commented May 26, 2023

exactly, if you console log the error, it will shows as { response: ..., request: ... }

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.

4 participants