<p dir="auto"><code class="notranslate">Deno will always die on unhandled exceptions / rejections.</code></p>
<p dir="auto">I'd like to request the ability to change this for uncaught promises.</p>
<p dir="auto">I know a lot of people just say hey if this happens it is your fault. Technically your right. But this is reality. And people make mistakes. Production crashing because of a mistake is a serious issue. Especially when it is so easily preventable. But the problem really gets amplified when even if you are perfect, and your code catches everything and everyone, <strong>you can still crash</strong> if one of your deps forgets. So you can not just rely on yourself being perfect but the entirety of the world needing to be perfect. This in my opinion makes Deno very hard to want to use in production. Processes crashing are not an acceptable solution imo.</p>
<p dir="auto">Let's take a look at a simple example. Please bare with me here.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/23035000/100954852-69ab8100-34e3-11eb-9f73-5891e82ba1aa.png"><img src="https://user-images.githubusercontent.com/23035000/100954852-69ab8100-34e3-11eb-9f73-5891e82ba1aa.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">In this example, what happens is the process crashes. Because the developer of that third party dep forgot to catch something. Now this could be god knows how many deps deep. So the argument that you have to check every line of your deps code isn't really possible realistically. Nor is having to check every single commit of every single dependecy. This just adds on to more reason of why Deno is impossible to use in production.</p>
<p dir="auto">If this was nested some 10-15 levels deep, we would never be able to debug this and even attempt a fix.</p>
<p dir="auto">This is all to say that Deno in production is really hard to vouch for. Realistically Deno is only usable in production if you do not use any deps for your projects.</p>
<hr>
<p dir="auto">Now for another point of view. Deno is realllllllly hard to use for beginners. A lot of users wanting to use my library are first time developers. This means they are just getting into their very first coding project EVER! I have made it as easy as possible for users like this to be able to get started. They can literally use the strictest TS settings without even needing to know a thing about typing or casting or anything. However, this 1 issue of them forgetting .catch is a serious issue.</p>
<p dir="auto">Time and time again I have users reporting their processes crashing because they simply forgot to catch something. Not have a training wheel so to speak makes this really difficult. A simple handler to prevent crashes could be soooo useful because I could have this internally built for them so it alerts them of where they are forgetting to catch so that they can fix their code and prevent their processes from crashing.</p>
<p dir="auto">I was looking for an equivalent to the Node.js "unhandledrejection" event in Deno, but it appears there isn't one on <code class="notranslate">globalThis</code>.</p>
<p dir="auto">There does appear to be an <code class="notranslate">onunhandledrejection</code> event handler <a href="https://github.com/denoland/deno/blob/master/cli/dts/lib.webworker.d.ts#L5468">defined on workers</a>, though.</p>
<p dir="auto">Is there an equivalent event outside of workers, and if not, could there be? <g-emoji class="g-emoji" alias="smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png">😄</g-emoji></p>