ably-js icon indicating copy to clipboard operation
ably-js copied to clipboard

Improve debuggability of promise rejections

Open Matt-Esch opened this issue 4 years ago • 0 comments

Quite often users are faced with unhandled promise rejection errors and are unable to figure out exactly which promise was unhandled. Some libraries offer methods for debugging this class of error, by either

  • Instrumenting the promises with stack traces on creation. When an error occurs, the promise creation stack trace is included.
  • Allowing a custom promise implementation, so users can instrument their own debugging.

(See: ioredis showFriendlyErrorStack https://github.com/luin/ioredis/blob/HEAD/API.md#new-commander)

We could also extend our promisify implementation to wrap callback errors with the name of the operation that is being promisified, as this will at least point people to the correct operation being unhandled correctly.

┆Issue is synchronized with this Jira Task by Unito

Matt-Esch avatar Aug 17 '21 10:08 Matt-Esch