Skip to content

Add TypeScript types for Exceptions/Errors #2007

Closed
@lambrospetrou

Description

@lambrospetrou

Describe the issue with documentation

Right now when there is an error calling an API the error object is basically of type any, and therefore you get zero typing information and help from the IDEs.

Even on the documentation website it's suggesting to do string checks on the error.name property in order to see what kind of error it is, and then decide accordingly.

This makes it very to properly handle errors, especially when there are several possible failures. For example, in the s3.headObject operation the failure could be a 404 (name=NotFound) or a 403.

It would be great to have concrete type definitions for TypeScript that is easy to use the error responses, similar to the happy case with XxxCommandInput/Output types.

Right now basically we have to check the API documentation for each operation used, e.g. API Head Object, to see what errors, or how they will probably be named.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationThis is a problem with documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions