Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

new $q(executor) does not catch exceptions #11472

Closed
@lapo-luchini

Description

@lapo-luchini

The following code prints UErr.

    try{
        $q(function (res, rej) {
            throw new Error('Wrong.');
        }).then(function () { $log.info('OK?');
        }).catch(function (e) { $log.info('Err', e);
        });
    } catch (e) { $log.info('UErr'); }

I'm not sure I understand the ES6 specs but in BlueBird (new Promise(executor)) and in Q (new Q.Promise(executor)) this prints Err [Error: Wrong.].

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions