Skip to content

TypeScript typedefs do not export error types #841

Closed
@gauthierm

Description

@gauthierm

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions