这是indexloc提供的服务,不要输入任何密码
Skip to content

unhandled promise rejection wrongly detected #310

@lal12

Description

@lal12

The following code leads to triggering of the unhandled exception handler, even though it is handled in the catch.

async function bla(){
	throw new Error('bla');
}

async function main(){
	setTimeout(()=>console.log('timeout'), 2000);
	try{
		await bla();
	}catch(e){
		console.log('catched', e);
	}
}
main();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions