Comment

Comment by rakeshpai

It isn't possible to have a single "wrapper" try/catch in JS, because of the event-loop nature of most JS hosts. This is because functions that are scheduled to run on the event loop (say, using a button click, or a ajax call), aren't in the same call-stack as the code that defined it. Since they aren't in the same call-stack, an outer try/catch won't work on the inner callback.
parent rakeshpai 14 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton