TypeScript : Incorrect usage of Promise constructor

Classification

Overview

The new Promise constructor takes as its argument an executing function that has the resolve and reject parameters that can be used to control the state of the created constructor.

If the executing function is asynchronous and generates an error, the error will be lost and the new Promise constructors will not be rejected. This can make it difficult to debug and fix some errors.

References

  1. MDN web docs: Promise