WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Client-side script: If an error is thrown in a Deferred callback, this error doesn't appear in the console, which makes debugging more difficult #501

@pomahtri

Description

@pomahtri

CodePen example: https://codepen.io/pomah33/pen/MWrRKMb?editors=0010

If an error was thrown in Deferred callback, this error doesn't appear in console, which makes debugging more difficult

Error possibly was caused by this PR: 6d97370#diff-24d8a479ae56566c65690364aa2156fff7613fd38bd024153579f15d92b26f91L73, when deferred-like method .done was changed to promise-like .then

But on error in 'then' section of deferred (not promise) hides without appearing in console

Samples to try in dev console:

new Promise((resolve) => { window.r1 = resolve; }).then(() => { throw new Error('my error'); })
r1()
const d = new $.Deferred()
d.then(() => { throw new Error('my error'); })
d.resolve()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions