Skip to content

Audit Promise return values #714

Open
@dpogue

Description

@dpogue

There are too many places where we have very inconsistent return types involving promises. Particularly cases where functions throw, return a resolving promise, and also return a rejecting promise. Also a lot of places where functions return promises that resolve with different value types in different paths.

HookRunner is one spot I've seen that's particularly bad for this, but I've seen it in a few other spots too.

My general recommendation:

  • Any function that returns a promise should never throw. It should reject the promise.
  • Any function that returns a promise should document the resolving value type of that promise, and ensure that only that value type is ever resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhacktoberfestGood issues to be tackled by newcomers as part of Hacktoberfest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions