Skip to content

Errors need to be more consistent #186

@TwitchBronBron

Description

@TwitchBronBron

There are several different types of data that we store on our errors in this library. There needs to be more consistency. For example, some errors have a .results object, but that results object can have multiple different structures.

I think need to do the following:

  • standardize on a name for "extra stuff about this error". Maybe data, details, info, etc.
  • try use the same structure for most things.
  • add explicit types for this property on the exceptions so we get typescript compile errors (and editor help) when used incorrectly.

Something like this?:

export class SomeError {
    constructor(message: string, details: { response: request.Response, body: any, someOtherProp: string; } )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions