Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unhandled promise rejection wrongly detected #310

Open
lal12 opened this issue Sep 1, 2022 · 3 comments
Open

unhandled promise rejection wrongly detected #310

lal12 opened this issue Sep 1, 2022 · 3 comments

Comments

@lal12
Copy link
Contributor

lal12 commented Sep 1, 2022

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();
@saghul
Copy link
Owner

saghul commented Sep 1, 2022

Alas this is a bug in QuickJS: bellard/quickjs#112

@lal12
Copy link
Contributor Author

lal12 commented Sep 1, 2022

Is the fix something you would consider merging in txiki? Doesn't seem like quickjs is currently actively maintained?

@saghul
Copy link
Owner

saghul commented Sep 1, 2022

I would yeah, but we need to check if it would actually work in our case because of we run jobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants