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

TypeScript typedefs do not export error types #841

Closed
gauthierm opened this issue May 8, 2019 · 3 comments · Fixed by #842
Closed

TypeScript typedefs do not export error types #841

gauthierm opened this issue May 8, 2019 · 3 comments · Fixed by #842

Comments

@gauthierm
Copy link

🐛 Bug Report

The TypeScript typedefs in index.d.ts do not include the errors key that is exported in index.js. This makes it impossible to import error types and check them in try/catch statements.

To Reproduce

Steps to reproduce the behavior:

Paste your code here:

import { Client, errors } from '@elastic/elasticsearch';

Expected behavior

I expect the errors structure to be imported so I can check e instanceof errors.ResponseError.

Paste the results here:

TypeScript says: `Module has no exported member 'errors'.`

Your Environment

  • node version: 10
  • @elastic/elasticsearch version: >=7.0.0
  • os: Mac
  • Using TypeScript typedefs
@delvedor
Copy link
Member

delvedor commented May 8, 2019

Hello, good catch!
Do you want to open a pr? :)

@gauthierm
Copy link
Author

Sure, I can do that later today.

@delvedor delvedor mentioned this issue May 9, 2019
@delvedor
Copy link
Member

delvedor commented May 9, 2019

Hello! I've opened #842 since I would like to cut a new release later today.
Thank you again for the report!

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

Successfully merging a pull request may close this issue.

2 participants