Skip to main content
Module

x/netzo/deno.d.ts>reportError

SDK for Netzo, the open Web platform to unify IoT devices, applications and services.
Go to Latest
function reportError
import { reportError } from "https://deno.land/x/netzo@v0.1.11/deno.d.ts";

Dispatch an uncaught exception. Similar to a synchronous version of:

setTimeout(() => { throw error; }, 0);

The error can not be caught with a try/catch block. An error event will be dispatched to the global scope. You can prevent the error from being reported to the console with Event.prototype.preventDefault():

addEventListener("error", (event) => {
  event.preventDefault();
});
reportError(new Error("foo")); // Will not be reported.

In Deno, this error will terminate the process if not intercepted like above.

Parameters

error: any