Skip to content

TypeError when a filter in catch handler is not a function #1517

@marijaselakovic

Description

@marijaselakovic
  1. What version of bluebird is the issue happening on?
    3.5.1

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32)
    Node.js v8.5, Ubuntu 16.04.4

  3. Did this issue happen with earlier version of bluebird?
    Not sure

If a non-function value is passed as a filter to catch I get the following error: TypeError: Cannot read property 'apply' of undefined
The following code demonstrates this:

var p2 = Promise.reject(10);
p2.catch(function(){return true},undefined)

You should consider adding a type check on arguments passed to catch.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions