Bluebird includes a few built-in error types for common usage. All error types have the same identity across different copies of bluebird module so that pattern matching works in
.catch. All error types have a constructor taking a message string as their first argument, with that message becoming the
.message property of the error object.
By default the error types need to be referenced from the Promise constructor, e.g. to get a reference to
var TimeoutError = Promise.TimeoutError. However, for convenience you will probably want to just make the references global.
© 2013–2017 Petka Antonov
Licensed under the MIT License.